This is what I have so far. It takes out my money but doesn't give the item.
leaderboard script
game.Players.PlayerAdded:connect(function(plr)
local stats = Instance.new("BoolValue",plr)
stats.Name = "leaderstats"
local cash = Instance.new("IntValue",stats)
cash.Name = "Zims"
cash.Value = 100
local cash = Instance.new("IntValue",stats)
cash.Name = "Kills"
cash.Value = 0
end)
local script to buy the item
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function(click)
if player.leaderstats.Zims.Value >= 10 then
player.leaderstats.Zims.Value = player.leaderstats.Zims.Value - 10
game.ServerStorage.Tools.Sword:Clone().Parent = player:WaitForChild("Backpack")
end
end)
