Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Hidden GUI not being hidden?

I'm having issues trying to make a nuke game with a GUI simulating flash blindness while kicking the player (The player has to enter a teleport to another place within the game before the nuke drops, the teleport being a door to a fallout shelter and the place being a fallout shelter). I have a GUI named nucflash in the starterGUI with a white frame meant to be to be hidden until after 3 minutes, but for some reason it shows up at the beginning of the game! The code is shown here. I hope someone can find a way to fix errors in this and tell me how.

game.StarterGui.nucflash.Frame.BackgroundTransparency=1
wait(180)
game.StarterGui.nucflash.Frame.BackgroundTransparency=0
end

1 comment

0

That's because when you play the game, the Gui is COPIED from the StarterGui to your Player. When a player is playing in the game, ALL guis inside StarterGui get copied into "PlayerGui" inside their player.

2 answers

When a player enters the game, all Gui's inside StarterGui are copied into the PlayerGui which is inside the player. (game.Players.billybobRAE.PlayerGui.nucflash)

So, to fix this, you would insert a LocalScript into the frame and type the following code.

wait(180)
script.Parent.Visible = false

You also have an 'end' in your script which causes an error as you're not closing off any function, statement, loop, etc. You can also simply use the Frame property, 'Visible' which can either be set to true or false.

--Put this in a locascript inside a TextButton inside the frame
script.Parent.Parent.Visible = false
wait(180)
script.Parent.Parent.Visible = false

2 comments

0

wouldnt you want visible to be trrue at the end?

0

also its niot working

This discussion is preserved as it was. New answers, comments, and votes are closed.