I’m using Fusion to build a UI in Roblox and accessing a stat like leaderstats.Likes.Value directly in a TextLabel. Here’s a snippet where I display it:
Text = leaderstats.Likes.Value
Will the UI automatically update if leaderstats.Likes.Value changes, or should I use the GetPropertyChangedSignal?
1 Like
Is leaderstats.Likes.Value a IntValue/StringValue? I’m 99% sure Fusion will only react automatically if you use a Fusion Value.
1 Like
ah yea then i guess just do GetPropertyChangedSignal(“Value”) on the IntValue/NumberValue and set the new value to a Fusion value might work right?
Ex:
local leaderstats = Player:FindFirstChild("leaderstats")
local likes = Scope:Value(leaderstats.Likes.Value)
leaderstats.Likes:GetPropertyChangedSignal("Value"):Connect(function()
likes:set(leaderstats.Likes.Value)
end)
And on the Text
Text = likes
2 Likes
Yep, though I would recommend trying to entirely convert the value into a Fusion Value with change events and instances , unless you are setting / creating the value on the server.
1 Like
Well yeah, I’m setting or changing the value on the server, so I guess use my method above?
1 Like
Yeah, that would probably be the best way to do it.
1 Like