|
| 24 Jul 2015 12:00 AM |
For some reason this script won't work.
function onChatted(msg, recipient, speaker)
local source = string.lower(speaker.Name)
msg = string.lower(msg)
if (msg == "kill") and speaker.Name == "Username" then for i, v in pairs(game.Players:GetPlayers()) do if v.Character then local char = v.Character local hum = char:FindFirstChild("Humanoid") if hum then hum:TakeDamage(hum.MaxHealth) end end end end
function onPlayerEntered(newPlayer)
newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
end
game.Players.ChildAdded:connect(onPlayerEntered)
Any replies are appreciated :D Also thanks to instawin for helping me with killing all players :D
|
|
|
| Report Abuse |
|
|
|
| 24 Jul 2015 02:10 AM |
Output? Also, did you try replacing
> speaker.Name == "Username"
with the username of the person using the command? |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2015 03:17 AM |
| There were no syntax errors, and I did, of course, replace username with the person. |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2015 03:29 AM |
I am not perfect at this,
correct me if I am wrong;
it does kill yourself? right? |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2015 03:33 AM |
| It kills the entire server. |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2015 03:38 AM |
| Fixed it, forgot I renamed humanoid, lol. |
|
|
| Report Abuse |
|
|