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

My script won't work when I try to change the visibility property of a text box. Help?

So when I used this script, the text box named text1 appears and stays on the screen. I can't get it to go away or show text2. Here's the script I used:

local text1 = game.StarterGui.ScreenGui.text1 local text2 = game.StarterGui.ScreenGui.text2

text1.Visible = true wait(3) text1.Visible = false wait(2) text2.Visible = true wait(3) text2.Visible = false

*Note - I'm a beginner, so I probably missed something obvious.

3 comments

0

The script didn't appear on the question how I wanted it to, but you get the idea.

0

any errors in the output?

0

nope

1 answer

✓ Accepted answer

StarterGui hold all the guis that'll be replicated to the player's PlayerGui. What the player sees on their screen are descendants of their PlayerGui. Instead use this script:

local player = game.Players.LocalPlayer
local pgui = player:WaitForChild('PlayerGui')
local sgui = pgui:WaitForChild('ScreenGui')

local text1 = sgui:WaitForChild('text1')
local text2 = sgui:WaitForChild('text2')

text1.Visible = true
wait(3)
text1.Visible = false
wait(2)
text2.Visible = true
wait(3)
text2.Visible = false

Also, to make your code look better, please use a codeblock. If this was helpful, please accept this answer.

2 comments

0

Thank you soooo much!!!

0

If this helped you, please accept this answer, there's an Accept Answer button below this answer

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