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

Textbox and Frame not showing up when visible is set to true?

This script is supposed to make a textbox pop up that says player X wins, but the textbox doesn't show up. In the properties the frame and textbox are both set to visible but it's not on the screen. I tried with and without the frame.

function winx()
	game.StarterGui.win.Frame.Visible = true
	game.StarterGui.win.Frame.TextBox.Visible = true
	game.StarterGui.win.Frame.TextBox.Text = "X wins!"
end

1 answer

✓ Accepted answer

Looking at it, it looks like you are editing it from the StarterGui. If this script (hopefully localscript) is within the win ScreenGui, it is fine.

an example could be

local screen = script.Parent -- this would be "win"
local frame = screen:FindFirstChild("Frame") --hopefully one frame
function winx() --frame is upvalued into this function
	local tbox = frame:FindFirstChild("TextBox") --I suggest using TextLabel
	frame.Visible = true -- guessing you want it tot be visable when this function is 
	tbox.Visible = true
	tbox.Text = "X wins!"
end

When a player enters the game, or when a player respawns, the StarterGui is somewhat cloned into the Player's PlayerGui If you want to edit it directly from there, the StarterGui will not do this for you.

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