Why is this Happening?

So I am making a buy with my own remote firing system(to make it simple) and I sent a table but the server is not receiving it.
Here is the error:
image
Here is my custom remote firer:

local module = {
	_path = game.ReplicatedStorage.Remotes
}
function module:Fire(_plr,_remote,_table,_cors)
	if _cors == "c" then
		print(_table,_remote)
		module._path:FindFirstChild(_remote):FireServer(_plr,_table)
	else
		module._path:FindFirstChild(_remote):FireClient(_plr,_table)
	end
	
end
return module

Here is where I am firing from(client):

local table2 = {require(game.ReplicatedStorage.ObjectTable)[object_name].Price,object_name,os.clock()-module.Time}
		require(game.ReplicatedStorage.RemotesService):Fire(game.Players.LocalPlayer,"RequestBuy",table2,"c")

And Here is where the problem is(Server):

game.ReplicatedStorage.Remotes.RequestBuy.OnServerEvent:Connect(function(plr,_table)
	print(plr,_table)
	if _table[3] < math.random(6,10) then
		if plr.Folder.Cash.Value >= _table[1] then
			require(game.ReplicatedStorage.RemotesService):Fire(plr,"Sucess",nil,"s")
		end
		require(game.ReplicatedStorage.RemotesService):Fire(plr,"Failed",nil,"s")
	end
end)

And advice or help could really help

Firing from client to server automatically adds the player argument, so there is no need to specify it here. It’s just causing _table to receive a second player arg.

When you print the players name and the table values, you can see your name 2 times. Then you are trying to get the 3rd value out of the table argument, which is a player. Do you accidentally send the player name insead of the table?

No I have not sent the players Name on accident I already checked what I am sending and everything seems fine

Thank you very much I have turned a blind eye on this because I have been using less remotes and remote functions

1 Like

The table argument printed on the second line of the server script outputs a player, not a table. You must have sent something other than the table to the server.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.