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

How do you make a GUI appear and disappear?

Asked by 6 years ago
Edited 6 years ago

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

0
Just do GuiNameHere.BackgroundTransparency = 1 (or 2) DzoJung 2 — 6y
0
With textboxes, you will have to change both the TextTransparency and BackgroundTransparency. It takes a little more writing, but at least you will know it works for certain. DzoJung 2 — 6y
0
(or 0) * DzoJung 2 — 6y
0
Ok, Thanks I'll try it and let you know how it works out Skyraider5 -21 — 6y
0
Didn't work, overtime I do something it works in the properties window but nothing ever changes on the screen Skyraider5 -21 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

To make a gui disappear:

GuiNameHere.Visible = false
0
Bigben that is wrong because GUIs don't even have a property called "Visible" they have a property called "Enabled". Frames inside of GUIs have a property called "Visible" but when I do the same thing with that it still doesn't work. This information was all in the question, please read it more carefully and see if you can help then. Skyraider5 -21 — 6y
0
Be more specific next time. bigbenbennett 18 — 6y
Ad

Answer this question