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

How can I change the text box on a surface gui on a brick, with a gui?

See screenshot: http://prntscr.com/527mas

PLEASE LOOK AT THE SCREENSHOT BEFORE YOU GO ON OR ANSWER

So, when I change the text in the screengui, I want the text box on a surface gui on a brick, to change to what I edit in the screengui!

Thanks, this will really help.

Aero.

P.S: If you do not understand, I'm happy to help.

1 answer

There is a event of TextBox objects called FocusLost. This event fires after the player who clicked on the GUI presses enter or clicks away from the GUI. In you're case, I'm going to assume that you want to make sure that the player presses enter in order to transfer over the text.

(Make sure this is in a local script)

local screenTextBox = script.Parent -- Location of Textbox on the screen
local partTextLabel = game.Workspace.Sign.SurfaceGui.TextLabel -- Location of text on block

screenTextBox.FocusLost:connect(function(enterPressed)
	if enterPressed then -- Make sure they loose focus due to enter press
		partTextLabel.Text = screenTextBox.Text -- Change text
	end
end)

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