Remote event "confuses" parameters

so, i tried to make a remote event,
but, it kept “confusing” other parameters as the player for some reason.
by confusing i mean the first parameter was the player,
i also cant show the code because i exited roblox studio without saving out of anger,
and i dont have any backups.

the remote event being fired looks like this:
game.ReplicatedStorage.Remotes.RemoteEvent:FireServer(player,parameter,parameter)
i also fired the remote event from the client.

1 Like

The first parameter is always the player, when you pass the first parameter from a LocalScript, it’s the second parameter on the server.

This is intended behavior.

Always leave the first spot as the player’s parameter when making a remote connection.

1 Like

The first argument from remote event to the server is always the player who fired the remote event that is normal

but the thing is, the first parameter is the player

You shouldn’t pass the player parameter, it’s automatic.

even if i dont pass the player parameter, it still errors

I can’t know the problem if you don’t show me the error message.

i think the error was: “Visible is not a valid member of userni3”

The problem is with the code you’re doing inside the event

Are you sending the player as an argument inside the remote event? Because that’s not necessary.

no i wasnt, but it gave me a error so i did, but the error still was there

wait, so on the client i dont mention the player but on the server i do?

Yes, a remote’s structure looks like this:

-- Client
RemoteEvent:FireServer(...) -- '...' are your arguments
-- Server
RemoteEvent.OnServerEvent:Connect(function(player, ...)
   -- the player who fired the remote is passed automatically as the first parameter
   -- '...' are the arguments you passed from the client
end)
2 Likes

client side:
your passing
(player, parameter, parameter)

server side:
what you think should happen
(player, parameter, parameter)

what the game is doing
(player, player, parameter, parameter)

and this confuses the game

and if you get any more errors after correcting the thing then theres probably something else going on but thats your problem to deal with

oh so on the client i dont parse the player and on the server i do mention the player because its automatically passed as the first parameter