Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I communicate from client to server?

Asked by 3 years ago

I want a client (a player) to be able to choose a "job" from a selection of multiple "job" choices via a GUI. Upon selection of a "job," the client's chosen "job" may be seen by the server and by other clients. How can this be done? Can this be done via scripts in the GUI or by remote events? Additionally, what signals can remote events send?

1 answer

Log in to vote
1
Answered by 3 years ago
Edited 3 years ago

You should try to do some research before posting here, but here is a rundown of remote events

On the client, you use the remote event to fire to the server, hence :FireServer. You can pass as many parameters as you want. When you pick up on the server, the first argument is always the player first, which fire server sends automatically. Then, you can pick up whatever you sent.

On the server, you have to fire to the client, along with which client you are firing too. So, you have to :FireClient(player) or it won't work, and the "player" you are sending cannot be nil and has to actually be the player. You can also fire all clients, which is useful for making a server gui, or something like that.

If you want to choose a "job", first you have to choose a job from the client. Then, you send a remote event to change a value or something.

I hope this has been of help :)

0
Thank you so much! ChirpPerson 74 — 3y
0
no problem :) Superexperiencedguy 199 — 3y
Ad

Answer this question