Are Udim2's (fromScale()) not working anymore?

Hi There, Fellow Developers I was making an FNF Charting Mod and when you click play it play a song, and the time bar goes up

So the issue is:

code3

code2

code4

So I tried programming the ending song on a repeat but that does not work! If you find any solutions please reply.

I don’t see anything that’s actually incrementing the size of the bar. You’re just constantly setting it to the same UDim2 values.

but the repeat resets it to the original scale? (-0.012, -0.001)

You said that the bar was supposed to increase, but I don’t see any code that does that?

Oh wait ima send the whole code

Also you never specified what the issue actually is. We can’t just magically fix your script if you don’t even tell us what’s wrong.

so basically when the song ends the timer should go to its original position, but it just keeps going and going down

That repeat loop is useless. You should only need to reposition the bar once to reset it. It looks like something else is interfering with the bar and you still haven’t shown us the full code. If there’s another loop that’s responsible for incrementing the bar, make sure there’s something that breaks the loop properly.

local events = script.Parent.Events
local module = require(script.Parent.MainModule)

events.PlaySong.Event:Connect(function()
	local timePos = script.Parent.Main.TimePosition.Bar
	local twn = game:GetService("TweenService")
	local sound = script.Parent.UploadedSound
	local isEnded = false
	local isAllowed = true
	sound:Play()	
	sound:WaitForChild("UploadedVoices"):Play()			

	sound.Ended:Connect(function()
		isEnded = true
	end)	
	
	spawn(function()
		while true do wait(0.1)
			if(not isEnded) then
				if(isAllowed) then
					twn:Create(timePos, TweenInfo.new(sound.TimeLength + sound.TimeLength * 2.7,Enum.EasingStyle.Sine), {
						Position = UDim2.fromScale(-0.012, timePos.Position.Y.Scale+2)
					}):Play()
					module.noteSection += 1 / 16/ 16
					twn:Create(script.Parent.Main.Chart,TweenInfo.new(0.5,Enum.EasingStyle.Sine), {
						Position = UDim2.fromScale(0.058, script.Parent.Main.Chart.Position.Y.Scale-module.noteSection / 16)
					}):Play()
				else
					timePos.Position = UDim2.fromScale(-0.012, -0.001)
					script.Parent.Main.Chart.Position = UDim2.fromScale(0.058, -0.074)
				end
			else
				sound:Stop()
				isAllowed = false
				repeat wait(0.01)
					timePos.Position = UDim2.fromScale(-0.012, -0.001)
					script.Parent.Main.Chart.Position = UDim2.fromScale(0.058, -0.074)		
				until timePos.Position == UDim2.fromScale(-0.012, -0.001) and script.Parent.Main.Chart.Position == UDim2.fromScale(0.058, -0.074)
				script.Parent.Configuration.isPlaying.Value = false
				module.noteSection = 0
				break
			end
		end
	end)
	
end)

ui

hey I sent the code if you have a solution please reply (I should have used task.wait() rather than wait())

video of the gameplay: