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

Is This Right? [ANSERWED]

I just want to check if this is right:

script.Parent.MouseClick:connect(function(click)
script.Parent.Parent.Rotation = Vector3.new(0, -45, 0)
wait(2)
script.Parent.Parent.Rotation = Vector3.new(0, -89.98, 0)
wait(2)
script.Parent.Parent.Rotation = Vector3.new(0, 0, 0)
end)

When you click the door do this: script>ClickDetector>Door and use Vector3 to rotate it. Will this work? (Checking with the master scripterz)

Well the one above was wrong! WIll this one work?

script.Parent.MouseClick:connect(function(click)
script.Parent.Parent.Rotation = CFrame.new(0, -45, 0)
wait(2)
script.Parent.Parent.Rotation = CFrame.new(0, -89.98, 0)
wait(2)
script.Parent.Parent.Rotation = CFrame.new(0, 0, 0)
end)

So the right was was:

script.Parent.MouseClick:connect(function(click)
script.Parent.Parent.CFrame = CFrame.Angles(0, -45, 0)
wait(2)
script.Parent.Parent.CFrame= CFrame.Angles(0, -89.98, 0)
wait(2)
script.Parent.Parent.CFrame = CFrame.Angles(0, 0, 0)
end)

1 answer

✓ Accepted answer

You need to use the CFrame.Angles() function, Vector3 is only for positions. So:

brick.CFrame = CFrame.Angles(x, y, z)
-- Not brick.Rotation

5 comments

0

YAY! Thanks!

0

Wait, I edited the post

0

Okay. Now thanks!

0

Remember, CFrame.Angles

0

I edited the post, recheck it.

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