Jump to content

Scaling multiple objects at once


quindo

Recommended Posts

Posted

Hey, I'm new to scripting, I need to know how to scale multiple objects at once, could somebody help me? Something like this:

obj = 
{ 
CreateOject(...), 
CreateOject(...), 
CreateOject(...) 
} 
  
SetObjectScale(obj,1.5) 
  

How can i do this?

Posted
  
obj = 
  
{ 
  
createObject(...), 
  
createObject(...), 
  
createObject(...) 
  
} 
for i=1, #obj do 
  
setObjectScale(obj[i],1.5) 
  
end 

Posted

It doesn't work, that's my current testing script:

function mapLoad ( ) 
   
objekt = { 
createObject ( 3458, 2500, -1645, 50, 0, 0, 0 ), 
createObject ( 3458, 2500, -1675, 50, 0, 0, 0 ), 
createObject ( 3458, 2480, -1660, 50, 0, 0, 90 ), 
createObject ( 3458, 2520, -1660, 50, 0, 0, 90 ) 
} 
for i=1, #objekt do 
SetObjectScale(objekt[i],1.5) 
end 
end 
  
addEventHandler ( "onResourceStart", getRootElement(), mapLoad ) 
  

it spawn normal sized objects, what am i doing wrong?

Posted

Oh sorry. I'm on mobile so.....

  
obj ={ 
  
createObject(...), 
  
createObject(...), 
  
createObject(...) 
  
} 
  
for i=1, #obj do 
setObjectScale(obj[i],1.5) 
  
end 

And fix SetObjectScale to setObjectScale.

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