Hi, so I have a GUI that I want to appear for five seconds and then disappear again but when I scripted it and tried it out, the GUI is enabled in the properties window on studio which means that it is being disabled, but the GUI itself doesn't actually appear. Then after five seconds, the enabled box on the properties window goes back to being unchecked (disabled) like it is supposed to but the GUI never actually appeared. If I enable the GUI in studio so that it is on the screen when I start the test, the same thing happens only vice versa, the GUI is enabled and visible on the screen, then after five seconds the enabled box gets unchecked in the properties window but the GUI doesn't go away. Basically, whatever the GUI is before I play it (enabled or disabled), it stays that way and won't change when the game is played. The same exact issue occurs if I try to change the visible property of the GUI's frame instead. I need the GUI to start off disabled, then become enabled (and appear on the screen), and then be disabled again (and disappear from the screen). Here is the script that is supposed to make the GUI appear and disappear, this script is also my main game script so it has a lot of totally unrelated to this question code in it so to make it easier for you, the lines that are involved in this question are lines 23, 79, 80, and 81 They are the ONES WITH THE ASTERISKS NEXT TO THEM. THE ASTERISKS IN THE SCRIPT ARE NOT ACTUALLY IN THE REAL ONE, I ADDED THEM HERE TO POINT OUT THE IMPORTANT PARTS OF THE CODE.
Clearly, you can still look at the entire code if you need to but these lines are the only ones that refer to the GUI.
local replicatedstorage = game:GetService("ReplicatedStorage") local status = replicatedstorage:WaitForChild("Intermission") local wr = replicatedstorage:WaitForChild("WelcomeRound") local er = replicatedstorage:WaitForChild("EmergencyRound") local bar = replicatedstorage:WaitForChild("BoatsArrivedRound") local ier = replicatedstorage:WaitForChild("IslandEvacuatedRound") local tr = game.Workspace.TRex local v = game.Workspace.Velociraptors local ir = game.Workspace.IndominusRex local ships = game.Workspace.RescueBoats:Clone() local boats = game.Workspace.RescueBoats local wall2 = game.Workspace.DisappearingWall:Clone() local wall = game.Workspace.DisappearingWall local pw = game.Workspace.PterodactylWalls local p2 = game.Workspace.Pterodactyls:Clone() local p = game.Workspace.Pterodactyls local pe2 = game.Workspace.PterodactylExhibit:Clone() local pe = game.Workspace.PterodactylExhibit local tr2 = game.Workspace.TRex:Clone() local v2 = game.Workspace.Velociraptors:Clone() local ir2 = game.Workspace.IndominusRex:Clone() **local sg = game.StarterGui.SurvivorsGui** while true do while game.Players.NumPlayers < 1 do -- how many players you want for the game to start. status.Value = "2 or more players are required to begin!" repeat wait(2) until game.Players.NumPlayers >= 1 -- how many players are in the game. end for i = 5,1,-1 do status.Value = "Intermission: "..i wait(1) status.Value = " " end local dead = game:GetService("Players"):GetPlayers() for _,v in pairs(dead) do v.character:MoveTo(game.Workspace.PlayersStartPoint.Position) boats:Destroy() wall.CanCollide = true pw.CanCollide = true pe:Destroy() pe = pe2:clone() pe.Parent = game.Workspace pe:makeJoints() p:Destroy() p = p2:clone() p.Parent = game.Workspace p:makeJoints() tr:Destroy() tr = tr2:clone() tr.Parent = game.Workspace tr:makeJoints() end wr.Value = "Welcome To Jurassic World! Explore The Park!" wait(5) wr.Value = " " wait(5) --115 er.Value = "Emergency! Assests Out Of Containment! Get To Safety!" wait(5) er.Value = " " pw.CanCollide = false tr:MoveTo(game.Workspace.TRexSpawn.Position) --ir:MoveTo(game.Workspace.IRexSpawn.Position) --v:MoveTo(game.Workspace.RaptorSpawn.Position) wait(5) --175 bar.Value = "The Rescue Boats Have Arrived! Get To The Docks!" wait(5) bar.Value = " " wall.CanCollide = false boats = ships:clone() boats.Parent = game.Workspace boats:makeJoints() wait(5) --115 ier.Value = "The Island Has Been Evacuated! All Known Survivors Rescued!" wait(5) ier.Value = " " **sg.Enabled = true** **wait(5)** **sg.Enabled = false** --next part moves players: local dead = game:GetService("Players"):GetPlayers() for _,v in pairs(dead) do v.Team = game:GetService("Teams").Tourists and v.character:MoveTo(game.Workspace.TouristSpawn.Position) wait(5) end end
If anyone could help me figure this out that would be REALLY great because I have never had this problem before and it is really important that I fix it. Thanks, Skyraider5
To make a gui disappear:
GuiNameHere.Visible = false