First would like to say that, I am 100% a noob at programming. I would appreciate any constructive criticism possible and or just simple tips. Just trying to mess with chat commands and I have looked at the guide on the Roblox wiki but, I wanted to try to write the code in a way that makes sense to me. Apparently what makes sense to me does not work so I was wondering If what I was programming is even close to being a working chunk of code.
Code -
local Players = game:GetService("Players")
function adminCommands(player, msg)
if msg == "kill" then
player.Character.Humanoid:TakeDamage(100)
end
end
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(adminCommands)
end)
Thanks, Loak

1 comment
Don't use TakeDamage for killing people. It's easier for exploiters to bypass and whatnot. Even kill() can't work. Just use BreakJoints() and it'll wipe em out. Also, your player you want to kill is located in workspace. Try game.Workspace:FindFirstChild(player)