I made a surfaceGUI with a TextBox, and I wanted to be able to input text directly into the TextBox - unfortunately this feature is locked. So instead, I tried to make a script which launched a GUI with a TextBox, and the text entered into the GUI TextBox would appear on the surfaceGUI TextBox.
Here's the script that's in the surfaceGUI TextBox - fairly simple - which won't take the text:
while true do script.Parent.Text = game.Workspace.GuiGiver.GUI.TextBox.Text end
Am I using the wrong "repeat" loop?
For a while loop, you should use a wait() statement for it can crash the game from infinitely looping without any time between each iteration. To fix this, just add in wait()
between line 1 and line 2. If you have any other questions, just leave a comment and I can help.
When writing a Script you need to write it in a Way where Studio Can Read It, for Example, When you put script.Parent.Text =
,Normally, Studio would see it as a quote, Lets say I want to add a Little Script in the Text, in this Case we would need two dots like this ..
, Now lets move on to the Script
gui = script.Parent -- Just to be simple, and Clean gui2 = game.Workspace.GuiGiver --I won't be using a Loop gui.Text = ""..gui2.Gui.TextBox.Text--Remember that the .. means INCLUDE
Hope this helped!