#Why does this not update every time it's called?

20 messages · Page 1 of 1 (latest)

hidden musk
#

I'm a bit confused, I'm just trying to make it so a label matches the player's leaderstat value, but it only changes it to the original value and it doesn't change whenever the leaderstat is changed?

mystic sun
#

cuz script runs 1 time

#

you should do

player.leaderstats.Gold:GetPropertyChangedSignal("Value"):Connect(function()
  label.Text = player.leaderstats.Gold.Value
end
hidden musk
#

wait really?

mystic sun
#

yes ;--;

hidden musk
#

this may sound stupid but

#

if scripts only run 1 time, then how do functions run?

mystic sun
#

bruh

#

you should know the basics 😭

untold geyser
hidden musk
#

ohh so it's just it runs once and is just idle until it a function is called?

untold geyser
#

That's not how code works

#

Everything in the script is executed at Runtime

#

You can connect to events, but the script only executes once and that's it

hidden musk
#

i see, thanks

twin fjord
untold geyser
#

I was thinking something along the lines of a RenderStepped loop

#

To not get that millisecond delay