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

How would i make a gui that follows a intvalue?

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?

1 comment

0

Wdym by "a gui that follows a intvalue"?

1 answer

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

1 comment

0

Awesom3, you've been mistaken, the argument of the callback is the property, NOT THE VALUE. please edit your answer.

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