Really unsure as to why my text is not updating within this script, if the boost value is 5, the text should say 10X GEMS, however, instead it prints out Unexpected Value: 5. Not sure why this doesn’t work as if the value is 5 the text should update, so the condition should have been accepted. Any help would be appreciated.
local player = game.Players.LocalPlayer
local boosts = player:WaitForChild("Multipliers"):WaitForChild("Boosts")
local function updateText()
print("Boosts value:", boosts.Value)
if boosts.Value == 0 then
script.Parent.Text = "2X GEMS!"
elseif boosts.Value == 2 then
script.Parent.Text = "5X GEMS!"
elseif boosts.Value == 5 then
script.Parent.Text = "10X GEMS!"
else
print("Unexpected value:", boosts.Value)
end
end
updateText()
boosts:GetPropertyChangedSignal("Value"):Connect(updateText)