For example I have a gui in which the player has to type something, how can I access localplayers text through server side script?
✓ ANSWER ACCEPTED
How to get localplayers gui text?
1 answer
✓ Accepted answer
You could have a RemoteFunction somewhere that both the server and client can see. (Workspace or ReplicatedStorage will do just fine)
On the client, you should do:
YourRemoteFunction.OnServerInvoke = function() --replace YourRemoteFunction with your RemoteFunction's location
return MyGui.Text --replace MyGui with wherever your GUI is located
end
This will basically say, "Hey, when the server fires this RemoteFunction, I want to give it whatever is written in MyGui.Text."
Now, on the server, you can very simply do:
local Text = YourRemoteFunction:InvokeClient(playerToSendTo)
print(Text) --prints whatever they have in their text entry
Just replace playerToSendTo with the player you want to ask for the input and you should be good to go.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
You can send that information via RemoteEvent
How would I use remoteEvent for it?