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
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Admin Commands Help

Previous Thread :: Next Thread 
Crazy010517 is not online. Crazy010517
Joined: 17 Sep 2011
Total Posts: 1161
17 Feb 2014 11:26 AM
I got that admin script from the Roblox Wiki which had the kill command on it.
When I added more commands, I have to type the whole username for that command to work... but the kill command still doesn't need the whole name.

local Admins = {["Crazy010517"] = true, ["Player1"] = true, ["NameHere"] = 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 Admins[player.Name] then
victim = findPlayer(message:sub(7))
if victim and victim.Character then
victim.Character:BreakJoints()
return end
elseif message:sub(1,7) == "/rocket" and Admins[player.Name] then
victim = findPlayer(message:sub(9))
if victim and victim.Character then
victim.Character.Torso.Velocity = Vector3.new(0,150,0)
return end
end
end


game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(message) onChatted(message, player) end)
end)
Report Abuse
Crazy010517 is not online. Crazy010517
Joined: 17 Sep 2011
Total Posts: 1161
17 Feb 2014 11:33 AM
Bump
Report Abuse
dragoneon is not online. dragoneon
Joined: 18 Jan 2010
Total Posts: 397
17 Feb 2014 11:36 AM
function findPlayer(name)
for _, player in ipairs(game.Players:GetPlayers()) do
if player.Name:sub(1,#name):lower() == name:lower() then
return player
end
end
end
Report Abuse
Crazy010517 is not online. Crazy010517
Joined: 17 Sep 2011
Total Posts: 1161
17 Feb 2014 11:45 AM
I think the kill command doesn't need the whole name cause I have kohl's admin in my Workspace too xD
Report Abuse
Crazy010517 is not online. Crazy010517
Joined: 17 Sep 2011
Total Posts: 1161
17 Feb 2014 11:46 AM
Sweet!
It works, thanks bro c:
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