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)
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~