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

Why doesn't this script prevent the GUI from reapearing?

Asked by 9 years ago

I need a script, that makes sure my GUI startup menu thingy doesn't reaper. I tried this code;

-- Main controller for the GUIs



Image = script.Parent.ImageLabel
TutorialAsk = script.Parent["Would you like to take the tutorial?"]
GUIYes = script.Parent.Yes
GUINo = script.Parent.No
Val = game.Workspace.Value.Value
while true do
wait(.1)
-- Loads the intro
if Val == 0 then
    Image.Visible = true

    wait(4)

    Image.Visible = false
    TutorialAsk.Visible = true
    GUIYes.Visible = true
    GUINo.Visible = true
    Val = Val+1
end
end

I used the values, because it is a 1 player game. Pls include step by step explainations. Here is how my tutorial is laid out; http://gyazo.com/5790f2db72cdc994d241d77c9097f6f0

The tutorial 1st shows a GUI that tells who made it, then asks the player if they want to take the tutorial.

If they say no, then it goes to the "Play" screen. If they say "yes" then it gives an explanation of the game, and then goes to the play screen.

What I am looking for, is a script that make the whole thing disappear when the player presses "Play". When the player dies, it does not show up again.

Pls help

1 answer

Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
9 years ago

Well, to do so, you can simply clone the GUI to their PlayerGui when they FIRST enter the game. Put the desired GUI in Lighting.

game.Players.PlayerAdded:connect(function(p)
    GUI = game.Lighting["GUI Name Here"]
    repeat wait() until p.PlayerGui
    GUI:clone().Parent = p.PlayerGui
end)
0
Doesnt work for some reason... adspace44 20 — 9y
0
Try now Shawnyg 4330 — 9y
Ad

Answer this question