-
What do you want to achieve? an animation of a text value changing one by one
-
What is the issue? the text doesn’t change
-
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