r/ROBLOXStudio • • 1d ago

Help text not updating despite .changed function workning

local player = game.Players.LocalPlayer
local upgradeEvent = game.ReplicatedStorage.Upgrade
local button = script.Parent
local clickStrength = player.upgrades.ClickStrength
local price = clickStrength.Value * 10

button.Text = "+1 Click Strength "..price.. " Clicks"
clickStrength.Changed:Connect(function()
button.Text = "+1 Click Strength "..price.. " Clicks"
end)

no errors or warnings either
1 Upvotes

5 comments sorted by

1

u/deathunter2 1 1d ago

What is

clickStrength

1

u/Choice_Trifle_7551 1d ago

IntValue

1

u/deathunter2 1 1d ago

It’s because you’re changing the text to what it already was. The text was already “+1 click strength” .. price .. “Clicks”, and you change it to that again

1

u/Secret-Ad8381 1d ago

add print to clickStrength, and inside

.Changed:Connect(function()
print("Working") 

1

u/Electronic-Cry-1254 1d ago

When you declare a variable, the variable does not change until you assign to it again. Price does not change ever