Jump to content

Objects


Recommended Posts

Posted

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"?

Posted

setElementVelocity

but im not sure if this work on objects ..

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

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

Posted
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 )

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