--Script to have the value of the cash change (below)
game.Players.PlayerAdded:Connect(function() local stats = Instance.new("IntValue") stats.Name = "leaderstats"
1 | local cash = Instance.new( "IntValue" ) |
2 | cash.Name = "Cash" |
3 | cash.Value = 0 |
4 | cash.Parent = stats |
5 | stats.Parent = game.Players.LocalPlayer |
end)
local cash = Instance.new("IntValue") local Money = game.StarterGui.MoneyGUI.Money
if cash.Value == 0 then cash.Value = cash.Value + 120 wait(.2) print("Worked") end
-- script to have the value shown onto the GUI ( below)
local player = game.Players.LocalPlayer local Cash = script.Parent:WaitForChild("Money")
while wait(1) do Cash.Text = player:WaitForChild("leaderstats"):WaitForChild("Cash").Value end
Just change the stat variable to where the Money is located.
1 | local player = game.Players.LocalPlayer |
2 | local stat = player.leaderstats:WaitForChild( "Money" ) |
3 | while wait() do |
4 | script.Parent.Text = stat.Value |
5 | end |
Please accept my answer if this helped!