Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make that when a player dies a value resets?

Hello, How do I make that When a player dies a value inside it resets? I have tried this:

while true do wait()
	if humanoid.Health == 0 then
		player.Health.Value = 3					
		
	end	
end

The value gets to 3 but whenever it goes down by 1 it instantly goes to -1, but not 2... Any Ideas?

Thank you.

1 answer

✓ Accepted answer

There is a way to make that easier :

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:connect(function(char)
		local hum = char:FindFirstChild("Humanoid")
		if hum then
			hum.Died:connect(function()
				plr.Money.Valie = 0
				end)
		end
		end)
end)

1 comment

0

Thank you, it worked

This discussion is preserved as it was. New answers, comments, and votes are closed.