Hello, I have this script for a shop and you can purchase gears in the shop, however it doesn’t work since it isn’t getting the value for my coins and not buying the item. I’ve already tried changing the local coins and still isn’t working. The coins is a number value located in players. It is not in leaderstas, just the player.
I am only a beginner so please don’t spoon-feed me
local items = game.ReplicatedStorage:WaitForChild("Items")
game.ReplicatedStorage:WaitForChild("OnItemBought").OnServerEvent:Connect(function(plr, itemBought)
if itemBought and itemBought:IsA("Tool") and itemBought.Parent == items then
local Coins = plr.Coins.Value
if Coins.Value >= itemBought.ShopGuiInfo.Price.Value then
Coins.Value -= itemBought.ShopGuiInfo.Price.Value
itemBought:Clone().Parent = plr.Backpack
end
end
end)```