I am seeing lots of scripts like this:

function RemoteFunction.OnClientInvoke(player, blah_parameters)

RemoteEvent.OnClientEvent:Connect(function(player, blah_moreParams)

The Client events/invokes don’t pass the player as parameter, but are needed to fire/invoke to.

RemoteFunction:InvokeClient(player, parameters)

RemoteEvent:FireClient(player, parameters)

Just to clear things up.

If you wanted to use the player in a LocalScript in a client event/invoke just use Players.LocalPlayer.

It’s only RemoteEvent.OnServerEvent and RemoteFunction.OnServerInvoke that pass the player (it’s automatically there by roblox!) as a parameter. If you named your parameter something other than player, plr, etc., it’s still a player and still the Player object!

RemoteEvent.OnServerEvent:Connect(function(player, parameters)

function RemoteFunction.OnServerInvoke(player, params) 

I even see code that add a player argument to the RemoteEvent:FireServer() and RemoteFunction:InvokeServer() methods. If this were to be done, there would have to be a second player parameter:

RemoteEvent.OnServerEvent:Connect(function(player, player2)

function RemoteFunction.OnServerInvoke(player, player2)

This post in no way is intended to be spam, or opinion based. Just a heads up for those who are confused with the player parameters.

4 comments

0

ScriptingHelpers should add a seperate space for community members to post helpful information like this

0

There is a forum too

0

Yeah but the forum is dead lol

0

This should be under the tutorial section on the forum