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

How to get localplayers gui text?

For example I have a gui in which the player has to type something, how can I access localplayers text through server side script?

2 comments

0

You can send that information via RemoteEvent

0

How would I use remoteEvent for it?

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.