|
| 03 Jan 2013 08:26 PM |
game.Players.xXTheRobotXx.Chatted:connect(function(msg) if msg == "kill/" then local playertokill = msg:sub(6) if game:GetPlayers(playertokill) then playertokill.Character:BreakJoints() end end end)
Just a simple little admin thing.
Error 407:["Siggy.exe not found."] Please try again in a few moments. |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 08:28 PM |
if msg == "kill/" then
should be
if string.sub(msg) == "kill/" then
local playertokill = msg:sub(6) if game:GetPlayers(playertokill) then playertokill.Character:BreakJoints()
should be
local playertokill = game.Players[msg:sub(6)] if playertokill then playertokill.Character:BreakJoints()
¬ LuaLearners Elite/Writer |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 03 Jan 2013 08:28 PM |
1) Make sure it checks that you're in the room or it will give a nil exception. 2) playertokill must be defined as a player, not a string. 3) Missing End ')' Try this:
repeat wait() until game.Players:FindFirstChild("xXTheRobotXx") game.Players.xXTheRobotXx.Chatted:connect(function(msg) if msg == "kill/" then local playertokillstr = msg:sub(6) local playertokill = game.Players:FindFirstChild(playertokillstr) if playertokill then playertokill.Character:BreakJoints() end end) end) |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 08:32 PM |
game.Players.xXTheRobotXx.Chatted:connect(function(msg) if string.sub(msg, 1,5) == "kill/" then playertokill = string.sub(msg, 6, #msg) if (game.Players:FindFirstChild(playertokill)) then playertokill.Character:BreakJoints() end end end)
|
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 08:34 PM |
None of yours worked.
:/
Error 407:["Siggy.exe not found."] Please try again in a few moments. |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2013 08:36 PM |
function onChatted(msg,man,speaker) if string.lower(speaker) == "xxtherobotxx" then if string.sub(msg, 1,5) == "kill/" then playertokill = string.sub(msg, 6, #msg) if (game.Players:FindFirstChild(playertokill)) then game.Players[playertokill].Character:BreakJoints() end end end
function onPlayerEntered(newPlayer) newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end) end
game.Players.ChildAdded:connect(onPlayerEntered) |
|
|
| Report Abuse |
|
|