Tween Numbers Effect

I’ve made a script that lets you tween numbers. This means you can go from number “0”, to number “3000” with a cool effect. This effect/script currently exists on Murder Mystery 2 to show how much XP you got in that round.

Create a ScreenGui and a Frame.
Insert a NumberValue inside the Frame.
Insert a TextLabel inside the Frame.


local part = script.Parent.NumberValue

local tweenInfo = TweenInfo.new(
	1,
	Enum.EasingStyle.Linear, 
	Enum.EasingDirection.Out, 
	1, 
	false, 
	0 
)

local tween = TweenService:Create(part, tweenInfo, {Value = 3000}) -- change 3000 to a variable that is numbers or any number you'd like e.g Value = XP (local XP = 3000)

tween:Play()

part.Changed:Connect(function(val)
	script.Parent.Text = tonumber(math.round(val))
end)```
5 Likes

Pretty sure you could just use a for loop

But this is useful

Could you possibly upload a GIF?

1 Like