Gui only work once

how do i make it so that code inside startergui only runs once? like when you die the code runs again and it supposed to only run once when you join the game.

i tried using game.Players.Playeradded:Connect(function() but it didnt work.

1 Like

Do you want to make it so the when you die there will be no more gui

1 Like

im making a press start to play gui and it aint supposed to run when you die

1 Like

Set the property “ResetOnSpawn” for the ScreenGui to false.

4 Likes

You can make it so the ScreenGui enabled property is false when you click the play button

1 Like
game.Players.PlayerAdded:Connect(function(player)
-- code here
script:Destroy()
end)