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

How do I make the text in a textbox change the text of something else?

I am making an IFE system and there is an Info panel where it displays details about the flight. The problem is, I have an admin panel where you change that info, but I cant figure out how to make a script to change the text.

What I am trying to do is set the TextLabel of the InfoBoard to whatever is inputted in the TextBox that's in the admin config.

I tried something like this:

script.Parent.Parent.Parent.InfoGUI.InfoBoard.Aircraft.Aircrafttype.Text = script.Parent.Text""

But it worked to no avail. Any help?

1 answer

✓ Accepted answer

Okay. First, insert a RemoteEvent into ReplicatedStorage and name it ChangeText. Next, insert a ServerScript into ServerScriptService. Leave it blank for now. Now edit the LocalScript and change it to this:

local ReplicatedStorage = game:GetService("ReplicatedStorage")

script.Parent.Parent.Parent.InfoGUI.InfoBoard.Aircraft.Aircrafttype.Text = script.Parent.Text
ReplicatedStorage:WaitForChild("ChangeText"):FireServer(script.Parent.Text, script.Parent.Parent.Parent.InfoGUI.InfoBoard.Aircraft.Aircrafttype)

This fires the RemoteEvent in ReplicatedStorage.

Now set the text of the ServerScript to this:

local ReplicatedStorage = game:GetService("ReplicatedStorage")

ReplicatedStorage:WaitForChild("ChangeText").OnServerEvent:Connect(function(player, text, textToSet)
	textToSet.Text = text
end)

This will set the text to the text of script.Parent.

Note: The LocalSscript will instantly run and fire the RemoteEvent. If you don't want this to happen, try putting the LocalScript code inside an event. For example, ClickDetetcor.MouseClick:Connect(function().

10 comments

1

Hmm. It seems we are going in the right direction but its not working. Whenever I type in something to the box, the Text property stays blank, but the info board is also blank.

0

Must be because of the client not effecting the server, therefore the script won't work. I think you have to use a RemoteEvent.

0

Im sorry, but I am not too familliar with RemoteEvents. Could you explain where to do it?

0

I will edit the post, hold on.

0

Okay, I have finished editing.

1

Thank you but it doesn't seem to work. I have read it and followed all of your steps.

0

Then I do not know what is happening, so I do not think I can fix it. Sorry.

0

Are there any errors happening?

1

No errors come up on the output.

0

Well, I don't know what's happening so I am afraid I cannot help you.

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