This is the part that i cant solve the problem:
remotes.BuyItem.OnServerEvent:Connect(function(player, itemName)
local priceItem = game.ServerStorage.Items[itemName]
local price = priceItem.Price.Value
local coins = player.PlayerData:WaitForChild("Coins")
-- Under here is the problem
if coins >= price then
coins = coins - price
The error i get is: ****bad argument #2 to '?' (string expected, got Object)
Could someone tell me what failed and how to fix it?

4 comments
intvalue*
now it says "attempt to compare string with number".
whichever value is the string that youre having problems with, as long as that string is displaying a number and not actual letters, use tonumber() itll convert it into a number value
also, a few things. you cannot call .Value when you are defining the variable, it must be called within your if statements or any other instance of you calling an value object within your code. and lastly you do not need a remote event to tell the server your local player is about to buy something. do not have a server script handle a local players stats, this can all be done from a local script.