Hello, so I have a tool, it's kind of a sword etc and I want it to respawn or kill players when I touch them with it.
Help appreciated please.
Hello, so I have a tool, it's kind of a sword etc and I want it to respawn or kill players when I touch them with it.
Help appreciated please.
You could try this code:
script.Parent.Touched:Connect(function(p)
local player = game.Players:GetPlayerFromCharacter(p.Parent)
if player then
p.Parent.Humanoid:TakeDamage(100)
end
end)
Why it works:
Simple, you make a script inside the tool, and using the touched event, it will kill (or respawn) the player.
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Do you mean the sword should kill a player on touch?
That also works, yes