Hey, I was working on a script and now this part of script is not working as expected, not sure what’s going on. Can someone help me
Script
for i = 3, 0, -1 do
PlrUI.Main.Starting:TweenSize(UDim2.new(0, 0, 0, 0), Enum.EasingDirection.In, Enum.EasingStyle.Quint, 0.2)
task.wait(0.3)
PlrUI.Main.Starting.Size = UDim2.new(0, 0, 0, 0)
if i == 0 then
i = "Move!"
end
PlrUI.Main.Starting.Counter.Text = i
PlrUI.Main.Starting.CounterShadow.Text = i
task.wait()
PlrUI.Main.Starting:TweenSize(UDim2.new(1, 0, 1, 0), Enum.EasingDirection.In, Enum.EasingStyle.Quint, 0.2)
game:GetService("SoundService"):WaitForChild("Sounds"):FindFirstChild("Counter"):Play()
task.wait(0.31)
game:GetService("SoundService"):WaitForChild("Sounds"):FindFirstChild("Counter"):Stop()
task.wait(0.49)
end
How it's working
How I want it to work (I don’t want the rotation part, just numbers coming out and going in)
I believe this would be possible to produce if creating a little wait in milliseconds, use index while linking to the numbers and their rotations, and TweenSize
Okay I made you an example you can utilize for your script. You should use the TweenService as it seems to be more utilized and you can even wait for it to finish. I just put a label into a transparent frame to try this.
local TweenService = game:GetService("TweenService")
local label = script.Parent
label.Size = UDim2.new()
local tweenInfo = TweenInfo.new(
1, -- Time
Enum.EasingStyle.Quint, -- EasingStyle
Enum.EasingDirection.InOut, -- EasingDirection
0, -- RepeatCount (when less than zero the tween will loop indefinitely)
true, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
for i = 3, 0, -1 do
label.Text = i
local tween1 = TweenService:Create(label, tweenInfo, { Size = UDim2.new(1,0,1,0) })
tween1:Play()
tween1.Completed:Wait()
end