If it is a separate chat script, this should work:
resetlist = { "reset","kill me","suicide" }
function onChatted(msg, recipient, speaker)
for i = 1,#resetlist do
if (string.lower(msg) == string.lower(resetlist[i])) then
speaker.Character.Humanoid.Health = 0
end
end
end
function onPlayerEntered(newPlayer)
newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
end
game.Players.ChildAdded:connect(onPlayerEntered) |