Issues with client replication

Hey DevForum, I have yet another problem that I’m a lil too inexperienced to tackle at the moment.

My issue is with client replication; more specifically, I’m trying to use a module to contain code for a moveset all players will be able to use. My problem is that I can’t figure out how to make these moves replicate to the server. It should be simple enough, but my real issue is LocalPlayer.

I have three scripts in total: a LocalScript which listens for input, a ModuleScript which obviously contains code for moves, and a server script which requires the ModuleScript.

The tl;dr is essentially that I need to use LocalPlayer in the ModuleScript but can’t because a server script is requiring it. Any help would be much appreciated.

You can use a RemoteEvent for this.

The player instance is automatically sent to the server, use that as the player’s name.

I was already using a RemoteEvent, but just to clarify, you’re telling me to use “player” as a parameter when I use :FireServer()?

No, OnServerEvent’s first parameter is the player instance (client) sending the request to the server.

1 Like

Oh! That was silly to miss. Thanks.

1 Like