Hi, Im trying to make a button that gives you a sword when you have enough money and reduces the Money leaderstat afterwards, but it doesnt work it gives the tool, but doesnt reduce the money.
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
local cash = player.leaderstats.Money.Value
if cash >= 50 then
cash = cash - 50
game.Lighting.Sword:Clone().Parent = player.Backpack
end
end)
Hope someone can help me

12 comments
this is a "copy" of a script i made it works fine with me it changes the leaderstats in filtering enbaled i put the script inside a local script inside a gui
Aye mate, you forgot to remove the ")" on line 7 where end is, remove it. :3
thx mate, its hard without roblox auto correct ;)
maybe u can help me with the leader board problem i have :3
i understand. ;)
;) yep
Sure.
;) u should see the "giving more points than expected" in the home page :3
Alrighty
ty that worked
ur welcome ;)a
ur welcome ;)