sam8985
|
  |
| Joined: 12 Nov 2011 |
| Total Posts: 582 |
|
|
| 15 May 2013 02:10 AM |
So, I made a script for script builder but I can't seem to get it to work. It's meant to stop people banning and kicking: ---------------------------------- Script.Parent = game.Workspace local isAdmin = {["sam8985"] = true function findPlayer(name) for _, player in ipairs(game.Players:GetPlayers()) do if player.Name:lower() == name:lower() then return player end end end function onChatted(message, player) if message:sub(1, 5) == "kill/" and isAdmin[player.Name] == false then victim = findPlayer(player) if victim and victim.Character then victim:Remove() m = Instance.new("Message", workspace) m.Text = (player.Name "has been removed from the server for an illegal message("..message..")") wait(4) m:Remove() end end end function onChatted(message, player) if message:sub(1, 6) == "/kill/" and isAdmin[player.Name] == false then victim = findPlayer(player.Name) if victim and victim.Character then victim:Remove() m = Instance.new("Message", workspace) m.Text = (player.Name "has been removed from the server for an illegal message("..message..")") wait(4) m:Remove() end end end function onChatted(message, player) if message:sub(1, 4) == "ban/" and isAdmin[player.Name] == false then victim = findPlayer(player.Name) if victim and victim.Character then victim:Remove() m = Instance.new("Message", workspace) m.Text = (player.Name "has been removed from the server for an illegal message("..message..")") wait(4) m:Remove() end end end function onChatted(message, player) if message:sub(1, 5) == "/ban/" and isAdmin[player.Name] == false then victim = findPlayer(player.Name) if victim and victim.Character then victim:Remove() m = Instance.new("Message", workspace) m.Text = (player.Name "has been removed from the server for an illegal message("..message..")") wait(4) m:Remove() end end end function onChatted(message, player) if message:sub(1, 6) == "/kick/" and isAdmin[player.Name] == false then victim = findPlayer(player.Name) if victim and victim.Character then victim:Remove() m = Instance.new("Message", workspace) m.Text = (player.Name "has been removed from the server for an illegal message("..message..")") wait(4) m:Remove() end end end function onChatted(message, player) if message:sub(1, 5) == "kick/" and isAdmin[player.Name] == false then victim = findPlayer(player.Name) if victim and victim.Character then victim:Remove() m = Instance.new("Message", workspace) m.Text = (player.Name "has been removed from the server for an illegal message("..message..")") wait(4) m:Remove() end end end function onChatted(message, player) if message:sub(1, 5) == ":kill" and isAdmin[player.Name] == false then victim = findPlayer(player) if victim and victim.Character then victim:Remove() m = Instance.new("Message", workspace) m.Text = (player.Name "has been removed from the server for an illegal message("..message..")") wait(4) m:Remove() end end end function onChatted(message, player) if message:sub(1, 5) == ":kick" and isAdmin[player.Name] == false then victim = findPlayer(player.Name) if victim and victim.Character then victim:Remove() m = Instance.new("Message", workspace) m.Text = (player.Name "has been removed from the server for an illegal message("..message..")") wait(4) m:Remove() end end end function onChatted(message, player) if message:sub(1, 5) == ":ban" and isAdmin[player.Name] == false then victim = findPlayer(player.Name) if victim and victim.Character then victim:Remove() m = Instance.new("Message", workspace) m.Text = (player.Name "has been removed from the server for an illegal message("..message..")") wait(4) m:Remove() end end end game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(message) onChatted(message, player) end) end) |
|
|
| Report Abuse |
|
sam8985
|
  |
| Joined: 12 Nov 2011 |
| Total Posts: 582 |
|
| |
shooter06
|
  |
| Joined: 13 Jan 2011 |
| Total Posts: 7443 |
|
| |