Jump to content

Objects


Recommended Posts

Help me ?

I have red barrels - and i want to drop them from my vehicle - I can make this work... except the objects dont move...

When you place a red barrel, to make it move you have to push it, right?

How do i make it so that if i create a red barrel, it drops by itself instead of needing to be "pushed"?

Link to comment

setElementVelocity doesnt work with objects, but you can do a little trick: create any vehicle (for example, flower pot, ID 594) set its alpha to zero, set it to be damage proof and then attach your object to it. Then you just should to apply setElementVelocity on your vehicle.

local pot = createVehicle( 594, 0, 0, 0 )
setElementAlpha( pot, 0 )
setVehicleDamageProof( pot, true )
local object = createObject( 1582, 0, 0, 0 )
attachElements( object, pot )
 
setElementVelocity( pot, 0, 0, 1.5 ) -- lets throw our object in air

Link to comment
Thats awesome, thanks, but now i have 1 problem - the objects are respawning after they blow up.

Do i set a timer and destroy the element?

No worries - i've done it :)

setTimer ( destroyElement, 6000, 1, pot )
setTimer ( destroyElement, 6000, 1, redbarrelobject )

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