Why are my event arguments changing?

Hello, I am trying to pass arguments in a RemoteEvent, but for some reason it changes. I know the first argument is the client that the event is fired from. I have no ideas what could be causing this.

rep.Events.VendSellEvent:FireServer(lplayer, player, price, item)
rep.Events.VendSellEvent.OnServerEvent:Connect(function(lplayer, player, price, item)
	print(lplayer) --Prints player
	print(player)-- Prints player
	print(price)-- Prints player???
	print(item)-- Prints price??
1 Like

FireServer implicity passes the player that fired it as the first argument.

You are correct that the first parameter should be the client the event is fired from, but you do not actually need to parse the client as an argument in your call, it is done for you.

Simply call it as such:

rep.Events.VendSellEvent:FireServer(player, price, item)

The local player will automatically be included for you.

1 Like

Theres two players as its code to be a selling thing, so i need the stored player value (player) and the local player (lplayer)

did you accidentally overwrite price anywhere while doing checks or something? like checking if the price is nil so you set it to a default value but you accidentally autocompleted player? it’s unlikely but it can happen.