I am stumped trying to figure it out how to do this
How to kill a player if touched by another player?
1 answer
i tried this
local player = game.Players:GetChildren() local giant = player[math.random(1, #player)]
giant.hit:Connect(function() player.Character.Humanoid.Health = 0 end)
4 comments
apart from this i dont know what to do
hmm you should do game.Players:GetPlayers() but get children can work but its kinda outdated and hard to understand, If its on a server script then do :TakeDamage() on the humanoid. and you should do giant.Character.HumanoidRootPart.Touched:Connect() cause you're indexing the player not the character and hit isn't a valid event/instance of the character. I reccomend doing debounce so then if lots
of players touch the same guy then it will just crash or make the guy lag alot and make his health go below 100. Those are just my reccomendations. with those steps you should be good!
thank you!
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
uhh do you have any attempts??