I'm testing outside ROBLOX Studio, it won't respawn once I attacked the humanoid. (Not a dummy, a real player)
Do I have to put p.Parent.Humanoid.Health == 0 ? I didn't use LocalScript, I used the normal script inside the tool.
local CanDamagePlayers = true
local damage = 3
script.Parent.Top.Touched:connect(function(p)
if p.Parent:FindFirstChild("Humanoid") and CanDamagePlayers == true and p.Parent.Humanoid.Health > 0 then
local plr = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
p.Parent.Humanoid:TakeDamage(damage)
script.Parent.Sound:Play()
plr.leaderstats.Pins.Value = plr.leaderstats.Pins.Value + 4
CanDamagePlayers = false
wait(1)
CanDamagePlayers = true
end
end)

4 comments
It needs to be a real player, not an NPC!
a real player respawns when it is killed
Yeah
so then where is the issue??