Attempt to perform arithmetic (mul) on nil and number

Unable to cast value to Object (chars chars)

Can you send your updated code?

I just remove Player and sent it as FireClient(Coins) so obviously it didnt work.

It printed -103 in the server script so its disspaering in the second client script and im still getting invalid argument #1 to ‘abs’ (number expected, got nil)

You only pass in coins for FireServer, but both player and coins for FireClient.

This is what I have

game.ReplicatedStorage.ErrorEvents.NotEnoughCoins.OnServerEvent:Connect(function(Player, Coins)
	game.ReplicatedStorage.ErrorEvents.NotEnoughCoins:FireClient(Player, Coins)
end)

and this wouldn’t work:

game.ReplicatedStorage.ErrorEvents.NotEnoughCoins.OnServerEvent:Connect(function(Player, Coins)
	game.ReplicatedStorage.ErrorEvents.NotEnoughCoins:FireClient(Coins)
end)

The top is correct, so what error are you getting?

no erros, but you told me to use the bottom one and I got unable to assign to player

I told you to use the top… can you send a screenshot of the error?

I’m using the top, you told me to use the bottom and im still using the top so there’s no error.

I’m confused. What’s the problem?

invalid argument #1 to ‘abs’ (number expected, got nil) in the last client script

Can you send the code in the script where the error is occuring?

game.ReplicatedStorage.ErrorEvents.NotEnoughCoins.OnClientEvent:Connect(function(MissingCoins)
local Coins250 = 1339932370
local Coins1000 = 1339932367
local Coins2500 = 1339932369
local Coins10000 = 1339932368

local Values = {{250,Coins250}, {1000,Coins1000}, {2500,Coins2500}, {10000,Coins10000}}

local ClosestTo = math.abs(MissingCoins)
local FetchCount = 1
local n=#Values
for i = 1,n  do
	if ClosestTo<Values[1][1] then
		local abc={Values[1][1], math.abs(ClosestTo - Values[1][1]),Values[1][2]}
		table.insert(Values,abc)
	end
	table.remove(Values,1)
end

table.sort(
	Values,
	function(a, b)
		return a[2] < b[2]
	end
)

for i = 1, FetchCount do
	game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, Values[i][3])
end

end)

did you try printing the missing coins in every part that you used/referenced it

Can you send the server script now?

Already did earlier, i havent ahcnged it

If you’re firing to the server then just immediately firing back to the client, why not just do it all on the client?

How? It’s 2 different script and theres multiple purchasable items theres like 20 im not gonna change all the scripts
I’ve done tthis for many things in my game and it works fine

yes, i understand it lowkey seems like a skill issue( no offense), but its okay we all start from somewhere. basically in the future you want your scripts to be optimized, and not do tasks that are already being handled automatically on your own.

ill keep trying to help you figure it out but, its going to be hard if we dont see( an actual screenshot) the output, your best bet is to spam print functions and see the output.