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

[SOLVED] Client And Server Relationship?

Asked by 4 years ago
Edited 4 years ago

Update: I seem to figure it out myself, thanks to those who tried to help :)

I am just wondering if I want to communicate from a LocalPlayer to the Server and to a RecipientPlayer, how can I do it? I'm not asking for a script or anything, just needed someone to give me a guide and tell me how it can be done.

If you are confused about what I'm talking about, I'll give you an example. So for example, when a LocalPlayer enters a Recipient Player's name and presses a "submit" button on a Gui to change something, I only want the RecipientPlayer to see the change. Let's say the change is something in the Workspace, how can I do this? (The reason why I use Workspace as an example is things located in locations like PlayerGui and stuff can be changed easily using RemoteEvents, but for Workspace, it will be harder)

Here's what I think I can do using Remote Events/Functions (maybe?), but I just don't know how... LocalPlayer's Client Server --> Server --> RecipientPlayer's Client Server

0
So then do you know how RemoteEvents work? If so, send the name of that target player to the server. Have the Server check if that player exists by looking for their name in Players service and store the player instance in a variable. Fire another RemoteEvent using :FireClient() with the argument of that player reference. xPolarium 1388 — 4y
0
@xPolarium yes dude I know, but I used Workspace as an example above. So if I want to change something in the Workspace (and make the change only visible to the RecipientPlayer), doing what you said will not work.. guest_20I8 266 — 4y
0
in the above example, xPolarium is right, though the change you make should be done within the OnClientEvent event of the recipient SerpentineKing 3885 — 4y
0
@SerpentineKing Oo, I tried to do that but it doesn't work, there's no error printed and I checked the script using many "prints" function. How can I do that? guest_20I8 266 — 4y
View all comments (2 more)
0
Because you know, the change happens in Workspace, what I don't know is how does passing the player helps since I want the communication to be from LocalPlayer's Server to Server then to RecipientPlayer's Server, not from LocalPlayer's Server to Server then back to LocalPlayer's Server guest_20I8 266 — 4y
0
@xPolarium Hi dude, may I know how do you "store the player instance in a variable" if you only have the name? guest_20I8 266 — 4y

Answer this question