generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Error?

Previous Thread :: Next Thread 
sam8985 is not online. 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 is not online. sam8985
Joined: 12 Nov 2011
Total Posts: 582
16 May 2013 05:11 AM
Bump
Report Abuse
shooter06 is not online. shooter06
Joined: 13 Jan 2011
Total Posts: 7443
16 May 2013 07:45 AM
[ Content Deleted ]
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image