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

How do u do an if then based on orientation?

I have tried the following and none of them work.

if script.Parent.Part.Orientation == script.Parent.Part.Orientation(0,-180,0) then
else if script.Parent.Part.Orientation == Vector3(0,-90,0) then
else if script.Parent.Part.Orientation == Vector3.new(0,-90,0) then

Any ideas?

1 answer

✓ Accepted answer

Actually they'd work if you wrote them correctly, here, I'll show you what you did wrong.

if script.Parent.Part.Orientation == script.Parent.Part.Orientation(0,-180,0) then

Should Be:

if script.Parent.Part.Orientation == Vector3.new(0,-180,0) then

AND

else if script.Parent.Part.Orientation == Vector3(0,-90,0) then

Should Be:

else if script.Parent.Part.Orientation == Vector3.new(0,-90,0) then

And the last one is perfectly fine.

2 comments

0

My bad, thanks. xD

0

No problemo

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