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

Rotation Script Not Working?

Asked by 8 years ago
while true do
script.Parent.CFrame=CFrame.new(5,-90,0)
wait()
script.Parent.CFrame=CFrame.new(10,-90,0)
wait()
script.Parent.CFrame=CFrame.new(15,-90,0)
wait()
script.Parent.CFrame=CFrame.new(20,-90,0)
wait()
script.Parent.CFrame=CFrame.new(25,-90,0)
wait()
script.Parent.CFrame=CFrame.new(30,-90,0)
wait()
script.Parent.CFrame=CFrame.new(35,-90,0)
wait()
script.Parent.CFrame=CFrame.new(40,-90,0)
wait()
script.Parent.CFrame=CFrame.new(45,-90,0)
wait()
script.Parent.CFrame=CFrame.new(50,-90,0)
wait()
end

2 answers

Log in to vote
0
Answered by 8 years ago
Edited 8 years ago

Problem:

You CFramed the part to different positions. You did not use a specific method such as CFrame.Angles(x, y, z) or CFrame.fromEulerAnglesXYZ(x, y, z). For that particular reason your infinite loop just re-locates the part to different locations.

Solution:

You want the part to rotate so you would have to use the CFrame.Angles(x, y, z) method or the CFrame.fromEulerAnglesXYZ(x, y, z) method. Let me demonstrate how you would use both of these methods to make the part rotate.

Script for CFrame.Angles() method:

while wait() do -- Infinite loop with a wait inside of it.
script.Parent.CFrame = script.Parent.CFrame * CFrame.Angles(0.1, 0.1, 0.1) -- Multiplying the original CFrame in increments of 0.1 every time the loop runs. Using the CFrame.Angles() method
end -- End for the loop

Here is the script for the CFrame.fromEulerAnglesXYZ() method there are pretty much the same with different methods:

while wait() do -- Infinite loop with a wait inside of it
script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0.1, 0.1, 0.1) -- Multiplying the original CFrame in increments of 0.1 every time the loop runs. Using the fromEulerAnglesXYZ() method.
end -- End for the loop

I hope the above answer helped you in one way or another. Thank you for putting your precious time into reading this answer.

~~ KingLoneCat

Ad
Log in to vote
-2
Answered by 8 years ago

Try this, I made this just now, and tested it, it worked for me, so good luck! (Insert it into your object)

while true do

script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0,0.01,0)
wait(0.0006)
end
0
If my script worked, please give me an Up vote :3 christiannewman 0 — 8y
0
-1 for having absolutely no explanation. This isn't a request website, don't just provide people with code. We point of the website is to help newbies learn Roblox Lua, not learn how to copy and paste. Link150 1355 — 8y
0
Oh yeah, sorry about that, man. I will give one next time. christiannewman 0 — 8y

Answer this question