Text doesnt change and doesnt print out any errors

  1. What do you want to achieve? an animation of a text value changing one by one

  2. What is the issue? the text doesn’t change

  3. What solutions have you tried so far? cant think of one

local player = game:GetService("Players").LocalPlayer
local coins = player:WaitForChild("Data"):WaitForChild("Coins")
local tweenService = game:GetService("TweenService")

local tweenTime = 1 -- Time in seconds
local easingStyle = Enum.EasingStyle.Quart -- Tween easing style
local easingDirection = Enum.EasingDirection.InOut -- Tween easing direction
local text = script.Parent.Text

local transitionAmount = Instance.new("IntValue")

transitionAmount.Value = coins.Value

coins.Changed:Connect(function(amount)
	local tween = tweenService:Create(
		transitionAmount,
		TweenInfo.new(tweenTime, easingStyle, easingDirection),
		{Value = amount}
	) -- Create a tween that changes TransitionAmount's value to the new money value.

	tween:Play()
end)

transitionAmount.Changed:Connect(function(amount)TransitionAmount changes, so during the tween.
	text = Comma(tostring(amount))
end)

the text doesnt change
no errors in output at all

text is a reference to the label current value, not the property itself. Instead, you should reference the .Text property when changing it not as a variable:

local label = script.Parent --not .Text!
--code
label.Text = Comma(tostring(amount)) --.Text here!
1 Like