Jump to content

attach


TheSmart

Recommended Posts

Posted

hey guys!

i was trying to attach fire on rock but idk why it not working :o

function fireRocks () 
    
  rock = createObject (3930, -2588.91, 83.9, 4.48, 90, 0, 0 ) 
 name = createFire ( x,  y,  z, 2) 
    attachElements ( name, rock, 0, 0, 2 ) 
 end 
addCommandHandler("fire", fireRocks) 

that error i got -,-

http://prntscr.com/7xh2fn

Posted
  
function fireRocks () 
    
  rock = createObject (3930, -2588.91, 83.9, 4.48, 90, 0, 0 ) 
 name = createFire ( 0,  0,  0, 2) 
    attachElements ( name, rock, 0, 0, 2 ) 
 end 
addCommandHandler("fire", fireRocks) 
  

Posted
wiki:

This is not compatible with all elements. The following elements are compatible:

Markers

Blips

Objects

Players

Vehicles

Sounds

Colshapes

Cameras

Weapons

Posted

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?

Posted

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

Posted

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 ) 

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

Posted
  
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

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

Posted

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 ) 

Posted
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

Posted

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 ) 
  

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