Jump to content

Vehicle upside down


'LinKin

Recommended Posts

Hello,

How can I know whether a vehicle is upside-down or not? getElementRotation?

This is what I get from getElementRotation, Y and Z are different while X wouldn't matter.

North: http://postimg.org/image/5z0ifub8t/

South: http://postimg.org/image/fm8m3atm5/

West: http://postimg.org/image/f82opyk4t/

East: http://postimg.org/image/5xqkmf9f1/

Has anyone made a function to return if the vehicle is upside-down? If not, I think it'd be useful if someone did it.

Thanks,

- LinKin.

Link to comment
Thanks. It's working, but let's say not 100%

When your car is upside down or is likely to be, it gets on fire.

That script works just if really it is upsidedown, but, if you're on these positions:

http://postimg.org/image/h67kc9xlb/ or http://postimg.org/image/zdzszfbdb/

It doesn't show it's upsidedown, but still, it will get on fire.

http://postimg.org/image/4q0qi0ne5/

If you read the code, you can clearly see it has a variable to change the threshold:

local UPSIDE_DOWN_THRESHOLD = math.cos(math.rad(20)) 

Set a higher value like 80 and try again.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...