An event that goes from client to server to a different client

I am trying to make it so that when a player presses a button it tells the server and then the server tells a different client that they can’t move for a couple of seconds. I added a remote event from a local script to tell the server, and then I made another remote event to tell a different local script however that local script doesnt have access to playerscripts. I know this sound kind of confusing but how can I do this better.

You have the right concept, but you can even do this with a single RemoteEvent, I believe. Just have both the clients and the server listening to the same event. If a client fires the event, none of the other clients will receive it until the server fires the event at a certain client.

Client Script:

local remoteEvent = game.ReplicatedStorage.RemoteEvent

local buttonPressed = function() -- Here we can fire the event from the client

   -- Make the player stop moving

Server Script:

local remoteEvent = game.ReplicatedStorage.RemoteEvent

   remoteEvent:FireClient() -- Put the player you want to freeze in here, or you can have the client tell the server who to freeze

I hope this helps, let me know if it does!

1 Like