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

How would i make a gui that follows a intvalue?

Asked by
hoth7 45
4 years ago
game.Players.PlayerAdded:Connect(function(plr)
    local leaderstats = Instance.new("Folder")
    leaderstats.Name = "leaderstats"
    leaderstats.Parent = plr

    local stats = Instance.new("Folder", plr)
    stats.Name = "Stats"

    local money = Instance.new("IntValue", stats)
    money.Name = "Money"


    local multiplier = Instance.new("IntValue", stats)
    multiplier.Name = "Multiplier"


    local rebirths = Instance.new("IntValue", stats)
    rebirths.Name = "Rebirths"

    local skill = Instance.new("IntValue", stats)
    skill.Name = "Skill"

    local claimable = Instance.new("BoolValue", stats)
    claimable.Name = "Claimable"
    claimable.Value = true

    local claimed = Instance.new("BoolValue", stats)
    claimed.Name = "Claimed"
    claimed.Value = false

    local boughtwrench = Instance.new("BoolValue", stats)
    boughtwrench.Name = "BoughtWrench"
    boughtwrench.Value = false


end)

To make this easier for you I'm trying to make a daily reward to save, and there tools to save, and this is a simulator game, is there anything you can do to help?

0
Wdym by "a gui that follows a intvalue"? Reset8449879 204 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

I would look into a .Changed Event. It's an event that fires when a value is changed!

For instance, in a local script, you could have:

local plr = game.Players.LocalPlayer
local leaderstats = plr:WaitForChild("leaderstats")

leaderstats:WaitForChild("Money").Changed:Connect(function(value)
    gui.TextLabel.Text = value --Change this
end)

If you would like more information on this, I'd visit this article on the wiki: https://developer.roblox.com/en-us/api-reference/event/Instance/Changed

Hope this is what you're looking for! Peace

0
Awesom3, you've been mistaken, the argument of the callback is the property, NOT THE VALUE. please edit your answer. mightydifferent 85 — 4y
Ad

Answer this question