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

i need a textbook to open up when a player clicks a textbutton?

My intermission will be a textbox that opens up when a player hits a textbutton. Unfortunately, my intermission bar just stays hidden even after I click.

local button = script.Parent
local intermission = game.StarterGui.intermission.TextBox
	intermission.Visible = false

local function close(click)	
	local title = script.Parent.Parent.Title
	local description = script.Parent.Parent.TextBox
	local click = script.Parent.MouseButton1Click
	if button and click then
		title:Destroy()
		description:Destroy()
		button:Destroy()
		game.StarterGui.Greeting:Destroy()
		intermission.Visible = true
	end
end


button.MouseButton1Click:Connect(close)

P.S. I want to make a GUI similar to Natural Disaster Survival, I may have more questions coming soon.

1 answer

✓ Accepted answer

You're issue is you're trying to get the StarterGui's Gui, Therefor, that's why it's not erroring; Because technically it is working. Just not for the PlayerGui

If you're wanting to get a playerGui while the game is active you need to use playergui

local Player = game.Players.LocalPlayer
local PlayerGui = Player:WaitForChild('PlayerGui')

local intermission = PlayerGui:WaitForChild('intermission').TextBox

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