Remote outputs my name instead of a Variable?

Title says all.

Remote Script:

local iremote = game.ReplicatedStorage.invCont

iremote.OnServerEvent:Connect(function(a, f)
	print(a, f)
end)

Local Script:

local iremote = game.ReplicatedStorage.invCont

script.Parent.MouseButton1Click:Connect(function()

iremote:FireServer("h", "g")

end)

Server Output:
200Tigersbloxed h

I’m very confused, any solutions?

1 Like

OnServerEvent takes the player object in as it’s first argument.

...:Connect(function(player, a, f) ...
2 Likes

OnServerEvent always include player as first argument. Wait, someone beat me to it. :frowning:

Let’s call it a tie :stuck_out_tongue:

1 Like

When you use :FireServer(), not only will it send the information attached to it, but also the player who the :FireServer() comes from. This helps the server to a get a better grasp of where it’s coming from, and can be of good use to secure RemoteEvents, & for other purposes if you want to implicate the player for something on the server. In this case, you could just add this into your Remote Script:

local iremote = game.ReplicatedStorage.invCont

iremote.OnServerEvent:Connect(function(plr, a, f) --This will let plr be the player argument, rather than a!
	print(a, f)
end)

All of them helped, I’ll just mark this post as solution