For example I have a gui in which the player has to type something, how can I access localplayers text through server side script?
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.