Jump to content

attach


TheSmart

Recommended Posts

ohh didn't see :P

well i want like that my friend say that :

is meteor / meteor and the stone falls 
yes, simbe objects don't have gravity, so i attached the meteor objects to a small, invisible vehicle, so they can fall down 
The stones are created with the createObject function. You can find the correct stone ids in the map editor 

M0Mzfpe.jpg

anyone explain me how to do that?

Link to comment

doesn't work

function fireRocks () 
   local rock = createObject ( 3930, -2815.18, 470.16, 4.86, 0, 354.488, 0 ) 
   local weapon = createWeapon ("Molotov", -2815.18, 470.16, 4.86 )  
   local fire = createFire ( -2815.18, 470.16, 4.86, 2) 
   attachElements ( rock, weapon, 0, 0, 2 ) 
   setTimer ( fire, 99999999, 1) 
   end 
addCommandHandler ( "fire", fireRocks ) 

that error i got

http://prntscr.com/7xj0ry

Link to comment

Try now

function fireRocks () 
   local rock = createObject ( 3930, -2815.18, 470.16, 4.86, 0, 354.488, 0 ) 
   local weapon = createWeapon ("Molotov", -2815.18, 470.16, 4.86 ) 
   local fire = createFire ( -2815.18, 470.16, 4.86, 2) 
   attachElements ( rock, weapon, 0, 0, 2 ) 
   setTimer ( fire, 99999999, 1,true) 
   end 
addCommandHandler ( "fire", fireRocks ) 

Link to comment
  
function fireRocks () 
   local rock = createObject ( 3930, -2815.18, 470.16, 4.86, 0, 354.488, 0 ) 
   local weapon = createWeapon ("Molotov", -2815.18, 470.16, 4.86 ) 
   local fire = createFire ( -2815.18, 470.16, 4.86, 2) 
   attachElements ( rock, weapon, 0, 0, 2 ) 
   setTimer ( createFire, 99999999, 1,fire) 
   end 
addCommandHandler ( "fire", fireRocks )  

Link to comment
  
function fireRocks () 
   local rock = createObject ( 3930, -2815.18, 470.16, 4.86, 0, 354.488, 0 ) 
   local weapon = createWeapon ("Molotov", -2815.18, 470.16, 4.86 ) 
   local fire = createFire ( -2815.18, 470.16, 4.86, 2) 
   attachElements ( rock, weapon, 0, 0, 2 ) 
   setTimer ( createFire, 99999999, 1,fire) 
   end 
addCommandHandler ( "fire", fireRocks )  

It won't works,you just added createFire in the setTimer, and createFire is already added with a difinition "fire", no need to do it two more time

Link to comment
  
function fireRocks() 
    local rock = createObject ( 3930, -2815.18, 470.16, 4.86, 0, 354.488, 0 ) 
    local weapon = createWeapon ("Molotov", -2815.18, 470.16, 4.86 ) 
    wX,wY,wZ = getElementPosition(weapon) 
    local fire = createFire ( wX,wY,wZ, 2) 
    attachElements(rock,weapon,0,0,2) 
    setTimer(function()  
        if fire then 
            createFire(wX,wY,wZ,2)  
        end 
    end, 120000,0) 
end 
addCommandHandler ( "fire", fireRocks ) 
  

This will create your desired fire at the coordinates -2815.18, 470.16, 4.86. The fire will be "reignited" every 2 minutes.

Link to comment

This will let it forever

  
function fireRocks () 
   local rock = createObject ( 3930, -2815.18, 470.16, 4.86, 0, 354.488, 0 ) 
   local weapon = createWeapon ("Molotov", -2815.18, 470.16, 4.86 ) 
   local fire = createFire ( -2815.18, 470.16, 4.86, 2) 
   attachElements ( rock, weapon, 0, 0, 2 ) 
   setTimer ( createFire, 99999999, 0,fire) 
   end 
addCommandHandler ( "fire", fireRocks ) 

Link to comment
This will let it forever
  
function fireRocks () 
   local rock = createObject ( 3930, -2815.18, 470.16, 4.86, 0, 354.488, 0 ) 
   local weapon = createWeapon ("Molotov", -2815.18, 470.16, 4.86 ) 
   local fire = createFire ( -2815.18, 470.16, 4.86, 2) 
   attachElements ( rock, weapon, 0, 0, 2 ) 
   setTimer ( createFire, 99999999, 0,fire) 
   end 
addCommandHandler ( "fire", fireRocks ) 

nope its gone

Link to comment

try this

function fireRocks () 
   local rock = createObject ( 3930, -2815.18, 470.16, 4.86, 0, 354.488, 0 ) 
   local weapon = createWeapon ("Molotov", -2815.18, 470.16, 4.86 ) 
   local fire = createFire ( -2815.18, 470.16, 4.86, 2) 
   attachElements ( rock, weapon, 0, 0, 2 ) 
   setTimer ( createFire, 1000, 0,fire) 
   end 
addCommandHandler ( "fire", fireRocks ) 
  

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