BlueTheFurry Posted February 15, 2015 Share Posted February 15, 2015 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
Et-win Posted February 15, 2015 Share Posted February 15, 2015 if (rx == -30) then PS: Please note it will only work when it's exactly -30, which is almost, ehh, never. Link to comment
BlueTheFurry Posted February 15, 2015 Author Share Posted February 15, 2015 i now made it like this: if (rx < -29) and (rx > -32 ) then setVehicleComponentPosition( theVeh, "movspoiler_25_1500", 30, 0, 0 ) but it still keeps doing it any ideas? EDIT: nevermind i'm just stupid <.< Link to comment
joaosilva099 Posted February 16, 2015 Share Posted February 16, 2015 rotation never gets negative, you should do this: if (rx < 360-29) and (rx > 360-32 ) then Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now