|
| 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 |
|
|
| |
|
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 |
|
|
|
| 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 |
|
|
|
| 17 Feb 2014 11:46 AM |
Sweet! It works, thanks bro c: |
|
|
| Report Abuse |
|
|