I am wondering if you can use tweenservice to tween a number in a script
local number = 1
game:GetService:("TweenService"):Create(number, TweenInfo.new(1), {0})
I am wondering if you can use tweenservice to tween a number in a script
local number = 1
game:GetService:("TweenService"):Create(number, TweenInfo.new(1), {0})
This should do it:
local tweenedNumber = 0
function tweenNumber(current, goal, totalSteps, runFunction)
for i = 1,totalSteps,goal/totalSteps do
tweenedNumber = i
if runFunction then
runFunction(i)
end
end
end
--to get the tween, use tweenNumber.
--example:
tweenNumber(0,30,30, function(x) print(x) end)
--prints out 1,2,3,4,5..30
This discussion is preserved as it was. New answers, comments, and votes are closed.