Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to change the value of a variable?

Asked by 4 years ago

How can you change the value of a variable from a script I do not have a leaderboard just this script My game is a sandbox tycoon game The currency is called "Money" I am finding it hard to understand the script can anyone help?

repeat wait(.1) until game.Players.LocalPlayer

local Player = game.Players.LocalPlayer
local RealMoney = Player:WaitForChild("RealMoney")
local Money = Player:WaitForChild("leaderstats").Money

local MoneyGui = script.Parent:WaitForChild("MoneyGui").MoneyGui.Money

MoneyGui.Text = Money.Value
Money.Changed:Connect(function()
    wait(.1)
    MoneyGui.Text = Money.Value
end)

Answer this question