Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

[SOLVED ]How to have the cash value changed to then have it portrayed onto the Money GUI?

--Script to have the value of the cash change (below)

game.Players.PlayerAdded:Connect(function() local stats = Instance.new("IntValue") stats.Name = "leaderstats"

local cash = Instance.new("IntValue")	
cash.Name = "Cash"
cash.Value = 0
cash.Parent = stats
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

1 answer

✓ Accepted answer

Just change the stat variable to where the Money is located.

local player = game.Players.LocalPlayer
local stat = player.leaderstats:WaitForChild("Money")
while wait() do
	script.Parent.Text = stat.Value
end

Please accept my answer if this helped!

This discussion is preserved as it was. New answers, comments, and votes are closed.