Remote function not giving the correct variables on invoke server?

I don’t know if it’s a bug or something that I did but when I try to invoke the server from the client with 3 variables it doesn’t work? Could somebody help to see what I did wrong?

Here’s the code:

Client-Side

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local enterVehicle = ReplicatedStorage.enterVehicle

local adornee = GUI.Adornee
local Car = adornee.Parent.Parent
local player = game.Players.LocalPlayer
local Camera = game.Workspace.CurrentCamera


print(player, Car, Camera)
enterVehicle:InvokeServer(player, Car, Camera)

Server Side

game.ReplicatedStorage.enterVehicle.OnServerInvoke = function(localPlayer, enteredCar, currentCamera)
	print(localPlayer, enteredCar, currentCamera)
end

This is what got printed in the output
Image from Gyazo

The client-side is what should be printed and the server-side is what actually printed.
I’ve tried switching out the variables and checking over it but couldn’t find the problem?

(I know I forgot to change the camera properties from the client side)

Do not pass in the player argument yourself, it does so automatically, you just need to pass in your other arguments

enterVehicle:InvokeServer(Car, Camera)
2 Likes

you are passing the player, the player automatically gets passed to the server

do

enterVehicle:InvokeServer(Car,Camera)

Thanks, that worked. I feel dumb lol

1 Like