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

How can I make a working lives gui? I can't seem to have the numbers count down on death.

For a game of mine, iv'e been wanting to make a lives gui like the one from the Roblox game: Super Chekpoint. Iv'e tried, but I just cant get it to work, can you maybe include some code that would do that? Create a gui and a number gui and that number would count down upon death, until it 0 lives are left. Game over screen is optional. Here's my code.

game.Players.PlayerRemoving:connect(function(reset)
	local player
	local dead
	local LivesNum
	local Lost
	local Lives
	if player(dead) then
		LivesNum = (Lost)
		Lost = (1)
		Lives = (25)
	end
	Lives = (25)
end)

1 comment

0

Code? We can't help without your attempted code. Sorry!

1 answer

You're not using the right event!

You're looking for Humanoid.Died() -- This'll trigger when the character dies.

You're trying to make it so when the player leaves, they lose a life.

-- || Services ||
local Players = game:GetService("Players")

-- || GettingPlayer ||
Players.PlayerAdded:connet(function(Player)
	Player.CharacterAdded:connect(function(Character)
		Character:FindFirstChildOfClass("Humanoid").Died:connect(function()
			
			 -- Your code goes here.
end) end) end)

Best of luck! Ask questions if needed~

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