I'm trying to make a screen with an empty textlabel that will change when a GUI's text is inputted and a button is pressed. An example would be: I open a GUI and put in "Test", I then press a button and the word "Test" appears onto the Surfacegui.
local box = script.Parent.Parent.Box local sa = workspace.screen.SurfaceGui.TextLabel local sb = workspace.Screen.SurfaceGui.TextLabel local enter = script.Parent enter.Mousebutton1click:Connect(function() sa.Text = box.Text sb.Text = box.Text end)
Thanks if you can help.
You would need a reference to the SurfaceGui and the GUI where you are inputting text. Then, set the surface gui's text to whatever the input TextBox.Text is whenever the button is fired, or if you want to make it dynamically change then fire upon the TextBox.Changed event.
local screenGuiText = -- reference to the input text box local surfaceGuiText = -- reference to the surface gui text label local button = -- reference to the enter button for the input button.MouseButton1Click:Connect(function() surfaceGuiText.Text = screenGuiText.Text end) -- or, for dynamic changing -- screenGuiText.Changed:Connect(function() surfaceGuiText.Text = screenGuiText.Text end)
Hope this helps.