my leade3rstats are called "Muscle" i need it for a simulator i made saving leaderstats so all i need is to make tool and Purchaseable tools please help me :D so i would apresiate help on purchasable tools :D
current code
local Player = game.Players.LocalPlayer
local Stats = Player:WaitForChild("leaderstats")
local Mucsle = Stats:WaitForChild("Muscle")
local Debounce = false -- this prevent from spamming the button! Button.MouseButton1Click:Connect(function() if Debounce == false then Debounce = true
Muscle.Value = Muscle.Value + 1 wait(1) -- this is the amount of secounds you should wait before getting more money! Debounce = false end
end)
Hey, no problem man. Heres some code to munch on.
script.Parent.Activated:Connect(function() local plr = game.Players:FindFirstChild(script.Parent.Parent.Name) if plr then local stats = plr:WaitForChild("leaderstats") local theStat = stats:WaitForChild("name_of_your_stat") theStat.Value = theStat.Value + 1 end end)