Script not working as expected

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)
image

1 Like

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

2 Likes

I tired adding few delays… still ended up with similar results

1 Like

Waiting for somone to help

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
1 Like

On testing and changing few thing… I got the issue, the text was resizing when the text value changed.
adding TextSize = 0 fixed the script

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.