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

How do I create a script that makes a ScreenGui disabled?

Asked by 5 years ago

I'm trying to make an intro with a black screen, then wait 5 seconds and the screen disappears revealing the game. Why doesn't this script work?

wait(5)
game.StarterGui:WaitForChild("ScreenGui").Enabled = false
end

The black screen is a frame set inside of the ScreenGui.

1 answer

Log in to vote
0
Answered by
chomboghai 2044 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago

You need to access the PlayerGui, and make sure you do it in a LocalScript.

-- localscript
local player = game.Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local screenGui = playerGui:WaitForChild("ScreenGui")

wait(5)
screenGui.Enabled = false

Hope this helps! :)

0
It did! Thanks! ccadeiscute -3 — 5y
0
accept his answer :d SulaymanArafat 230 — 5y
Ad

Answer this question