Im trying to make it to where when someone says "nil me" there player gets removed I am editing the Become Anybody Script ( Hopefully everyone is aware of what that script is )
so here is my code.
function onChatted(msg, recipient, speaker) local source = string.lower(speaker.Name) if (string.sub(msg,1,4) == "nil me") then speaker.remove() end end game.Players.ChildAdded:connect(onPlayerEntered)
any answers and Possibly explanations on why this is wrong would be helpful.
Well the main problem I see is that it should be :remove()
not .remove()
. Otherwise I don't really see any problems.
That isn't the primary problem, but it is one.
game.Players.PlayerAdded:connect(function(plr) plr.Chatted:connect(function(msg) if (msg:sub(1,4) == "nil ") then if (msg:sub(5) == "me") then plr.Parent = nil; else targ = game.Players[msg:sub(5)]; targ.Parent = nil; end end end) end)