root = getRootElement () can_call = false function vehicleDrop ( source, command, x, y, z, id ) if ( not x or not y or not z or not id ) then outputConsole ( "Sorry pal, you are not using vehicleDrop(x, y, z, carid) correctly" ) else hitshape = createColCuboid ( tonumber(x), tonumber(y), tonumber(z), 10.0, 10.0, 2.0 ) chute = createObject ( 2903, 0, 0, 0 ) dropvehicle = createVehicle ( tonumber(id), tonumber(x), tonumber(y), tonumber(z)+20 ) attachElementToElement ( chute, dropvehicle, 0, 0, 8 ) setElementVelocity ( dropvehicle, 0, 0, 0.1 ) can_call = true end end function hit_shape ( dropvehicle, matchingInterior ) if ( can_call ) then detachElementFromElement ( chute, dropvehicle ) destroyElement ( chute ) x2, y2, z2 = getElementPosition ( hitshape ) setElementPosition ( dropvehicle, tonumber(x2), tonumber(y2), tonumber(z2) ) setElementVelocity ( dropvehicle, 0, 0, 0.1 ) end end addCommandHandler ( "vehicledrop", vehicleDrop ) addEventHandler ( "onElementColShapeHit", hitshape, hit_shape )