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

Why doesn't this script rotate my block named "DOPE"?

DOPE = game.Workspace:FindFirstChild("DOPE")
FINISHED = "Finished Rotating Part, now what"
i = 0

function rotate()
for i > -1 do
	for 1 < 19 do
	wait(1)
	DOPE.Rotation = CFrame.new(0,i + 1,0)
end
end

rotate()

4 comments

0

Because Dope is a drug and drugs are bad in roblox/s

0

Because rotation is a Vector3, not a CFrame.

0

you are missing an "end"

0

-1 is taken as an arithmetic problem and thus is shown as "minus one"

1 answer

✓ Accepted answer

You had a few things wrong and I'll show you each separately.

DOPE = game.Workspace:FindFirstChild("DOPE")
FINISHED = "Finished Rotating Part, now what"

Not sure why FINISHED is there but kept it anyway.

function rotate()
	for i=1,10 do
		wait(1)
		DOPE.Rotation = Vector3.new(0,i+1,0)
	end
end	

rotate()

I think you were getting your thinking of how the for i works for loops. You change 10 to the amount of times you want the loop to run. Also Rotation is not a CFrame value its a Vector3 value. All together now

DOPE = game.Workspace:FindFirstChild("DOPE")
FINISHED = "Finished Rotating Part, now what"

function rotate()
	for i=1,10 do
		wait(1)
		DOPE.Rotation = Vector3.new(0,i+1,0)
	end
end	

rotate()

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