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

GUI Server script for TUTORIAL only working a tiny bit?

Asked by 4 years ago
Edited 4 years ago

Hello, I am trying to make a tutorial for a game, but it is not working? Only the first GUI appears but it doesn't disappear and no other GUIs disappear. This is in Workspace and it is a server script.

-- Defining the variables
local Bridge = game.StarterGui.ScreenGui.one
local Danger = game.StarterGui.ScreenGui.two
local Hen = game.StarterGui.ScreenGui.three
-- Code
wait(0.1)
Bridge.Visible = true
wait(5)
Bridge.Visible = false
Danger.Visible = true
wait(5)
Danger.Visible = false
Hen.Visible = true
wait(5)
Hen.Visible = false
0
If you took this from a model in the catalog please send the link so I can look at the guis too. Also, are you sure the GUIs are in the right place? Torren_Mr 334 — 4y
0
They are in the same place, and no, I made the script myself. squidiskool 208 — 4y

2 answers

Log in to vote
0
Answered by
Torren_Mr 334 Moderation Voter
4 years ago
Edited 4 years ago

Alright. As all the things in StarterGui get placed to players personal Gui folder you need to include the script in the ScreenGui. You also need to change the variables. Here is the script.

-- Defining the variables
local Bridge = script.Parent.one --Changed it to find it from the parent.
local Danger = script.Parent.two
local Hen = script.Parent.three
-- Code
wait(0.1)
Bridge.Visible = true
wait(5)
Bridge.Visible = false
Danger.Visible = true
wait(5)
Danger.Visible = false
Hen.Visible = true
wait(5)
Hen.Visible = false

So you will have to replace the current script with the one above and move it to "ScreenGui"

1
Thanks! Now it's working! squidiskool 208 — 4y
0
Please don't forget to accept this answer and upvote please :) Torren_Mr 334 — 4y
Ad
Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

You should put the script in the StarterGui to make it simpler for the Local variables. like so... It was possibly the placement itself, but from what I did it seems to work perfectly so I suggest when trying to do something like this put the ServerScript in the Frames Parent (a.k.a ScreenGui) If this helped you please upvote!

----[|Script|]----

local Bridge = script.Parent.one
local Danger = script.Parent.two
local Hen = script.Parent.three

wait(0.1)
Bridge.Visible = true
wait(5)
Bridge.Visible = false
    Danger.Visible = true
    wait(5)
    Danger.Visible = false
        Hen.Visible = true
        wait(5)
        Hen.Visible = false

Answer this question