GUI = game.Lighting.AdminGui game.Players.PlayerAdded:connect(function(player) game.Workspace:WaitForChild(player.Name) if (player.Name == "coolcardriver1") then GUI:clone().Parent = player.PlayerGui if plr.Health == 0 then --up until here it stops working GUI:remove() GUI = backup:clone() GUI.Parent = game.Workspace GUI:makeJoints() end
Basically, the script is meant to show me the admin gui, the first but works until the 'if plr.name' from there it doesn't work, what I'm trying to do is make it show up after I die/respawn. Thanks.
local clone = GUI:Clone() clone.Parent = player.PlayerGui
By doing
if plr.Health == 0 then --up until here it stops working GUI:remove()
You make the thing in Lighting removed...
the script should be like this:
GUI = game.Lighting.AdminGui game.Players.PlayerAdded:connect(function(player) game.Workspace:WaitForChild(player) if player.Name == "coolcardriver1" then local clone == GUI:clone() clone.Parent = player.PlayerGui if plr.Health == 0 then clone:remove() --GUI = backup:clone() --Backup is not specified, so I do not understand it --GUI.Parent = game.Workspace --You are changing the parent of somethign that is deleted... --GUI:makeJoints() -- I don't see the point of this end end -- put more end end end) end