Jump to content

if rotx == "-30" then?


BlueTheFurry

Recommended Posts

Hello community, its me again, today i am trying to make a ImvehFT spoiler script, that opens the spoiler if you type a command, here is my code:

  
addCommandHandler("movspoiler", 
    function() 
        theVeh = getPedOccupiedVehicle( localPlayer ) 
        if theVeh then 
        rx, ry, rz = getVehicleComponentRotation(theVeh, "movspoiler_25_1500" ) 
        setTimer( function() 
        if theVeh then 
        rx, ry, rz = getVehicleComponentRotation(theVeh, "movspoiler_25_1500" ) 
        if tostring(rx) == "-30" then 
        setVehicleComponentPosition( theVeh, "movspoiler_25_1500", 30, 0, 0 ) 
        else 
        setVehicleComponentRotation(theVeh, "movspoiler_25_1500", rx-2, 0, 0 ) 
        setVehicleComponentVisible( theVeh, "movspoiler_25_1500", true ) 
        end 
        end  
        end, 50, 0 ) 
        end 
    end) 

The problem is, the spoiler keeps spinning, any ideas, it must be something @ "if tostring(rx) == "-30" then"

but i cant figure out how to check if its a negative number,

Greetings!

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...