Strings between client-server

Hi!

I want to transfer strings from a UI TextBox to a server script and not sure how to do it. I tried with RemoteEvent, but it didn’t really work. Any suggestions please?

We can’t really help you if you don’t show us a script.

I mean, if I edit the text in the textbox and try to get it with a serverscript, it returns nothing from the texts.

Could you still show us your script so we can debug it, please?

Are you making the server script try to retrieve it directly or are you giving it to the RemoteEvent|? If you’re trying to make it retrieve itself, the server will always see it as nil as the Text property changes on the client, you need to give the new text yourself

So I can only get it through a remote event witht the server? I will keep trying then

What I meant is this if I didn’t explai nit thoroughly

If you want to give the server text of a textbox, you cannot make the server go to it itself because the change will not replicate to the server. You need it to pass it as an argument of FireServer

ExampleRemote.OnServerEvent:Connect(function(player, text)

end)
ExampleRemote:FireServer(textbox.Text)

Also tip if you don’t already know, don’t fire in the player argument yourself, it’s passed in by itself automatically

1 Like