how do i use this script ingame.
I tried kick/playername that didnt work
-- Anaminus
print("Command Center Loaded")
banner = game.Workspace:findFirstChild("Ban Players")
permission = { "bloodmark3","","" }
function checkOkToLetIn(name)
for i = 1,#permission do
-- convert strings to all upper case, otherwise we will let in
-- "Telamon" but not "telamon" or "tELAMON"
if (string.upper(name) == string.upper(permission[i])) then return true end
end
return false
end
function ban(name, source)
local p=game.Workspace:findFirstChild(name)
if p==nil then return end
-- if (name == source) then return end
local player = game.Players:findFirstChild(name)
local m = Instance.new("Message")
m.Parent = player
m.Text = "*hey noobsicle y where u pesting players and me?*"
wait(2)
m.Text = "EAT BAN NOOB"
wait(2)
m.Text = "XD"
wait(2)
m.Text = "*hits you with ban hammah*"
wait(2)
m.Text = "your banned HAHA."
wait(2)
m.Parent = nil
p.Parent = nil
player.Parent = nil
if banner ~= nil then
local I = Instance.new("IntValue")
I.Name = name
I.Parent = banner.BannedPlayers
end
end
function onChatted(msg, recipient, speaker)
-- convert to all lower case
local source = string.lower(speaker.Name)
msg = string.lower(msg)
-- Below is only for me
if (checkOkToLetIn(source)) then
if string.match(msg, "kick out") then
local players=game.Players:children()
for i=1, #players do
if string.match(msg, string.lower(players[i].Name)) then
ban(players[i].Name, source)
return
end
end
end
end
end
function onPlayerEntered(newPlayer)
newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
end
game.Players.ChildAdded:connect(onPlayerEntered) |