Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 7 years ago
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()
0
Because Dope is a drug and drugs are bad in roblox/s rexbit 707 — 7y
0
Because rotation is a Vector3, not a CFrame. GoldenPhysics 474 — 7y
0
you are missing an "end" QuantumToast 261 — 7y
0
-1 is taken as an arithmetic problem and thus is shown as "minus one" itsJooJoo 195 — 7y

1 answer

Log in to vote
1
Answered by 7 years ago

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()
Ad

Answer this question