Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a gui re appear after player died?

Asked by 7 years ago

So i have a figthing game with a gui class selection screen, the gui appears when a player connects but when a player dies, the gui wont appear again. How do I make it appear? My current code:

1    Menu = script.Menu
2 
3 
4game.Players.PlayerAdded:connect(function(player)
5    local MenuClone = Menu:Clone()
6    MenuClone.Parent = player.PlayerGui
7end)

Menu is the name of the ScreenGui.

0
Place it in StarterGui? awesomeipod 607 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago
1local Menu = script.Menu
2 
3game.Players.PlayerAdded:Connect(function(player)
4    player.CharacterAdded:Connect(function()
5        local MenuClone = Menu:Clone()
6        MenuClone.Parent = player.PlayerGui
7    end)
8end)
0
.CharacterAdded event triggers whenever the player respawns Le_Teapots 913 — 7y
Ad

Answer this question