Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- AdmiralDonut
- speakers = {"BINO2002,"LIEFMIEJSE44","robbie280"} -- Those who can say the command
- banned = {"PointCoded","SavageMunkey","iispecialeffects"} -- Those who are banned
- function check(name)
- print(name)
- if #speakers == 0 then print("No speakers") return false end
- for i = 1,#speakers do
- if string.upper(name) == string.upper(speakers[i]) then return true end
- end
- return false
- end
- function ban(player, source)
- if player ~= nil then
- if player ~= source then
- player:Remove()
- table.insert(banned,player.Name)
- end
- end
- end
- function unban(player,source)
- if player ~= nil then
- for i = 1,#banned do
- if banned[i]:lower() == player.Name:lower() then
- table.remove(banned,i)
- end
- end
- end
- end
- function onChatted(msg, recipient, speaker)
- local norm = msg
- local msg = string.lower(msg)
- if not check(speaker.Name) then return end
- if string.match(msg,"unban") then
- local players = game.Players:GetPlayers()
- for n = 1, #players do
- if string.match(msg,players[n].Name:lower()) then
- unban(players[n], speaker)
- end
- end
- return
- end
- if string.match(msg,"ban") then
- local players = game.Players:GetPlayers()
- for n = 1, #players do
- if string.match(msg,players[n].Name:lower()) then
- ban(players[n], speaker)
- end
- end
- return
- end
- end
- function onPlayerEntered(newPlayer)
- print("entered")
- newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
- for i=1, #banned do
- if banned[i]:lower() == newPlayer.Name:lower() then
- newPlayer.Parent = nil
- end
- end
- end
- game.Players.ChildAdded:connect(onPlayerEntered)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement