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

How to make this rotate faster?

Can anyone tell me how to make this rotate faster? this whole script work's fine beside's it rotating to slow.

local label = script.Parent.DropLabel

script.Parent.SelectorStart.MouseButton1Click:connect(function()
	for i = 1, 90 do
		label.Rotation = label.Rotation + 1
		wait(0)
	end
end)

1 answer

✓ Accepted answer

Add more increments, but with less iterations.

90 x 1 == 90, of which is your end goal.

for i = 1, 90 do
	label.Rotation = label.Rotation + 1
	wait()
end

45 x 2 == 90; twice as fast, same result.

for i = 1, 45 do
	label.Rotation = label.Rotation + 2
	wait()
end

30 x 3 == 90; thrice as fast, same result.

for i = 1, 30 do
	label.Rotation = label.Rotation + 3
	wait()
end

If you're using a local script, you could implement RenderStepped:wait().

RS = game:GetService("RunService")
-- function opens
for i = 1, 90 do
	label.Rotation = label.Rotation + 1
	RS.RenderStepped:wait()
end
-- function closes

The loop will iterate the next time the frame changes.

1 comment

0

Would make it look extremely choppy.

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