Need a helping hand (Script/Lua)

Hello, im working on something for my friends server, we were trying to make our Vehicles Blow up when hit and i was doing ok with the FX, Explosion Damage n Sound, etc untill i get to the point of making the Script calculate the position of the Car that’s exploding to make it jump into the air.

I already used the Gmod Wiki but it gave us no examples about how to use most of the lua codes and i would really appreciate any wise person who wants to help me with this :slight_smile:

– I wanted to make this so the vehicle that’s being blown up ignites players and stuff around him (actually just ignites itself) and make it fly into the air, i used SetVelocity, but i can’t get it to work properly, i guess i need to hook the vehicle to the SetVelocity somehow, but i can’t find the answer :blush:

This is the part of the code im stuck right now:




			local explosion = ents.Create( "env_explosion" )
			explosion:SetPos( car:GetPos( ) )
			explosion:Spawn( )
			explosion:Fire( "explode", "", 0 )
			vehicle:Ignite( 15, 330 ) 
			vehicle:SetVelocity (Vector (0, 0, 1000))

Any lua veterans? :slight_smile:


vehicle:GetPhysicsObject():SetVelocity( Vector( 0, 0, 1000 ) )

SetVelocity doesn’t work on entities unless it’s a player.

oooh, i feel so dumb! thanks you Joey! :smiley: