Hi, I've been looking a while and can't find the answer for this. So basically, I'm trying to fix a bug in my game which makes the guis disappear when the player respawns. So what I've been trying to do is make it so the gui re-appears, but it won't. The thing is though, the print message will send even after the gui should show. I've been trying to fix this for ages but it won't work. Help would be appreciated!
Here is the local script inside starter Gui:
local Player = game.Players.LocalPlayer -- I was just testing with the first button which is for bugs.
local Char = Player.Character or Player.CharacterAdded:Wait()
local died = false
local Bugs = script.Parent.Parent:WaitForChild("Bugs")
local Bugsbutton = Bugs:WaitForChild("TextButton")
Char:WaitForChild("Humanoid").Died:Connect(function()
died = true
print("Dead")
end)
Player.CharacterAdded:Connect(function(Char)
print("Respawned")
if died == true then
Bugsbutton.Visible = true -- Won't appear
print("Bugs Visible") -- Still prints
end
died = false
end)

3 comments
Thanks, I'll see if this works!
Yep, it works. Thank you so much!
glad to help.