TimeLength Problem

So, I have a vfx effect play at the length of the sound, but when I do “sound.TimeLenth” it equals to “0”. Could someone help me?

local timeEffect = 0
		
		for i,v in pairs(newBall:GetDescendants()) do
			if v:IsA("Sound") then
				v:Play()
				print(v.TimeLength) -- when I do print(v.Name) it prints the name so it should work right? print(v.TimeLength) prints 0
				if timeEffect < v.TimeLength then
					timeEffect = v.TimeLength
				end
			end
		end
		
		if timeEffect > 10 then
			timeEffect -= 2
		end
		print(timeEffect) -- prints 0
		wait(timeEffect) -- waits 0 seconds long


Maybe try to check if the sound is loaded before checking the TimeLength?

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