So in many games you will see many he effect I’m looking for here is a video I finally found Pay attention to the global rank see how the number changes that’s what I’m going for and no I didnt just see this video and wanted to create it I have been trying it this for a long time.
I’m not really asking for code just an idea on how to do it
This would work, lerping would have less of a performance impact and look smoother though.
local Game = game
local Script = script
local RunService = Game:GetService("RunService")
local TextLabel = Script.Parent
local function LerpNumber(StartNumber, EndNumber, Duration)
local StartTime = RunService.Stepped:Wait()
while true do
local CurrentTime = RunService.Stepped:Wait()
if (CurrentTime - StartTime) > Duration then break end
TextLabel.Text = math.round((EndNumber - StartNumber) * ((CurrentTime - StartTime) / Duration))
end
TextLabel.Text = EndNumber
end
task.wait(5)
LerpNumber(0, 1000, 3)
@KdudeDev when I tween it immediately cuts to the value it doesnt like animate it I don’t know what I’m doing there @Forummer works great! Is just that when changing it, it restarts from zero and then animates it towards the final number I want it to start from the starting number and then animate to the end number
local Game = game
local Script = script
local RunService = Game:GetService("RunService")
local TextLabel = Script.Parent
local function LerpNumber(StartNumber, EndNumber, Duration)
local StartTime = RunService.Stepped:Wait()
while true do
local CurrentTime = RunService.Stepped:Wait()
if (CurrentTime - StartTime) > Duration then break end
TextLabel.Text = math.round((EndNumber - StartNumber) * ((CurrentTime - StartTime) / Duration)) + StartNumber -- just added the start number
end
TextLabel.Text = EndNumber
end
task.wait(5)
LerpNumber(tonumber(TextLabel.Text), 1000, 3) -- adding the tonumber doesn't fix anything it's just better in the context its being used