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

GUI not resetting on spawn correctly?

Asked by 4 years ago
Edited 4 years ago

So I'm trying to make a CTF game using the available Roblox template and I'm having a problem where my health gui is not Resetting once the player dies or resets and I tried to fix the problem by going to the DisplayScript which is located on StarterPlayerScripts. I inserted the Health GUI as a chilld of the DisplayScript in order for the health gui to appear in StarterGUI, and edited the DisplayScript but somehow when the player dies or reset the Health GUI still doesn't reset on spawn and I can't just make the main gui (ScreenGUI) change it's ResetPlayerGuiOnSpawn to true because it just breaks the entire game. Please give any sort of assistance, this problem has already wasted a few hours of my life.

-- Local Variables
local ScreenGui = script.ScreenGui
local HealthGui = script.HealthGui

local InIntermission = false

-- Initialization

game.StarterGui.ResetPlayerGuiOnSpawn = false
ScreenGui.Parent = Player:WaitForChild("PlayerGui")

game.StarterGui.ResetPlayerGuiOnSpawn = true --
HealthGui.Parent = Player:WaitForChild("PlayerGui")

Answer this question