So lets say you have a shop GUI, and your in a shop GUI. It shows your coins inside the shop but lets say you were then to get more coins whilst having the shop GUI open.
How would you script it so that an event fires whenever coins (inside a leaderstats or something) is updated, and then updating the coins value in the GUI Shop.
gotta use Changed function or you can update it every few seconds because i dont like using Changed function as it doesnt update when player joins its just update when your coins value changes
i prefer updating it ever few seconds anyways its up to you
here is a script i made for you
local function update()
YourLabelHere.Text = "Cash:"..game.Player.LocalPlayer.leaderstats.CurrencyName.Value
end
— player joined
update()
Cash.Changed:Connect(update)
He was not the topic creator and these options are both equally good, only I prefer the one from @EmeraldLimes, because you don’t have to create an infinite loop, which is incredibly less lag for mobile players, for example.