I need a script like this for my shop but it won't work please help me the script is
local price = script.Parent.Parent.Price
local tools = game.ReplicatedStorage:WaitForChild("Tools")
local tool = script.Parent.Parent.ItemName
local player = script.Parent.Parent.Parent.Parent.Parent.Parent
script.Parent.MouseButton1Click:Connect(function()
if player.leaderstats:FindFirstChild("Smelly Bucks").Value >= price.Value then
player.leaderstats:FindFirstChild("Smelly Bucks").Value = player.leaderstats:FindFirstChild("Smelly Bucks").value - price.Value
game.ReplicatedStorage.ShopBuy:FireServer(tool.Value)
end
end)
Dose anyone know what is wrong with this?

2 comments
The line between 8 and 9 the value after "Smelly Bucks" is not with an capital V.
I think that should work!