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

Gui to reappear when player die?

I made this script so that when players join they can see the Class select gui But the problem is how do I make it reappear when the player die or reset his/her character?

game.Players.PlayerAdded:Connect(function(plr)
	local CloneMe = game.ServerStorage.ClassLoadout:Clone()
	CloneMe.Parent = plr.PlayerGui
end)

2 comments

0

!! You can't add any Gui elements from the server side, it can only be done from the client

0

what are you trying to do? just use .Died for a death screen(if thats what ur trying to do)

2 answers

i solved your problem!

game.Players.PlayerAdded:Connect(function(plr)
	plr.Changed:Connect(function()
    local CloneMe = game.ServerStorage.ClassLoadout:Clone()
    CloneMe.Parent = plr.PlayerGui
	end)
    local CloneMe = game.ServerStorage.ClassLoadout:Clone()
    CloneMe.Parent = plr.PlayerGui
end)

2 comments

0

It will reappear but it will not stop on duping it self

0

idk what is the script(s) in the CloneMe, soi not can helpya well

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:connect(funcion(char)
	   	 local CloneMe = game.ServerStorage.ClassLoadout:Clone()
	  	 CloneMe.Parent = plr.PlayerGui
	end)
end)

This gives you the gui when the character is added.

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