Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How am i going to stop the the loop in an exact time i want?

This is the script. i want to break the loop in like 1.25 seconds

		while wait() do
			print(player)
		hum.BodyDepthScale.Value=hum.BodyDepthScale.Value+0.1
		hum.BodyWidthScale.Value=hum.BodyDepthScale.Value+0.1
		hum.BodyHeightScale.Value=hum.BodyHeightScale.Value+0.1
		hum.HeadScale.Value= hum.HeadScale.Value+0.1
		end

but when i put

		while wait() do
			print(player)
		hum.BodyDepthScale.Value=hum.BodyDepthScale.Value+0.1
		hum.BodyWidthScale.Value=hum.BodyDepthScale.Value+0.1
		hum.BodyHeightScale.Value=hum.BodyHeightScale.Value+0.1
		hum.HeadScale.Value= hum.HeadScale.Value+0.1\
	------wait(1.25)
	------break
		end

it stop instantly? THANKYOU IN ADVANCE.

1 answer

✓ Accepted answer

It probably isn't the most practical, but you could run a spawn function or coroutine that breaks the loop after waiting 1.25 seconds.

local BreakLoop = false

spawn(function()
	wait(1.25)
	BreakLoop = true
end)

repeat wait()
	--do stuff
until BreakLoop

This discussion is preserved as it was. New answers, comments, and votes are closed.