Jump to content

my first fail with dynamic objects


Faw[Ful]

Recommended Posts

I fellow the wiki and I make this script :

addEventHandler ( "onResourceStart", getRootElement(), resource_starts ) 
  
function resource_starts () 
object1 = createObject ( 2053, 5041.107421875, 2517.9289550781, 35.989669799805, 33.997192382813, 179.99450683594, 179.99450683594 ) 
object2 = createObject ( 2053, 5098.576171875, 2517.919921875, 35.989669799805, 33.99169921875, 179.99450683594, 179.99450683594 ) 
object3 = createObject ( 2053, 5155.91015625, 2517.9384765625, 35.989669799805, 33.99169921875, 179.99450683594, 179.99450683594 ) 
move1_1 () 
end 
  
function move1_1 () 
moveObject ( object1, 2000, 0, 0, 0, 360, 0, 0 ) 
moveObject ( object2, 2000, 0, 0, 0, 360, 0, 0 ) 
moveObject ( object3, 2000, 0, 0, 0, 360, 0, 0 ) 
setTimer ( move1_1, 2000, 0 ) 
end 
  

You will say " ID its a hat ", yes, but I replace it with a working custom model, so the script just dont work I cant see the created objects and of course they dont move, I dont forget the meta and additionaly I try it with a normal sa object and its dont work, so I need to know whats wrong in this script.

What I want its a loop rotation of 360 on the x axis !

Link to comment

addEventHandler ( "onResourceStart", getRootElement(), resource_starts )

the "resource_starts" function doesn't exist yet at this point when the addEventHandler is called.

Move this whole line below the "end" of the function (resource_starts that is) code.

Link to comment

dont work wtf :evil:

now script look like that :

function resource_starts() 
object1 = createObject ( 2053, 5041.107421875, 2517.9289550781, 35.989669799805, 33.997192382813, 179.99450683594, 179.99450683594 ) 
object2 = createObject ( 2053, 5098.576171875, 2517.919921875, 35.989669799805, 33.99169921875, 179.99450683594, 179.99450683594 ) 
object3 = createObject ( 2053, 5155.91015625, 2517.9384765625, 35.989669799805, 33.99169921875, 179.99450683594, 179.99450683594 ) 
end 
addEventHandler ( "onResourceStart", getRootElement(), resource_starts ) 
  
function move1_1() 
moveObject ( object1, 2000, 0, 0, 0, 180, 0, 0 ) 
moveObject ( object2, 2000, 0, 0, 0, 180, 0, 0 ) 
moveObject ( object3, 2000, 0, 0, 0, 180, 0, 0 ) 
end 
setTimer ( move1_1, 2000, 0 ) 
addEventHandler ( "onResourceStart", getRootElement(), move1_1 ) 
  

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