Jockie Posted April 18, 2010 Share Posted April 18, 2010 I'm a bit sad because I can't use this. createObject( 1225, 3923.9899902344, math.random(461,351.8), 2.0592248439789, 90,0,0) It would be usefull for spawning random objects at random places. :> Link to comment
Jockie Posted April 18, 2010 Author Share Posted April 18, 2010 function moveBarrel(object) local x,y,z = getElementPosition(object) moveObject (object, 45000, x - MOVE_DELTA, y, z) setTimer(respawnBarrel,45000,1,object) end function respawnBarrel(object) destroyElement(object) newBarrel = createObject( 1225, 3923.9899902344, math.random(461,351.8), 2.0592248439789, 90,0,0) setTimer(moveBarrel, 50, 1, newBarrel) end And this: http://img28.imageshack.us/img28/6507/createobjectpr.png Link to comment
Mr.Hankey Posted April 18, 2010 Share Posted April 18, 2010 The first argument of math.random is the lower and the second the upper limit for the number to be generated. In your case the lower limit is greater than the upper which makes no sense and thus gives you an error. Link to comment
Jockie Posted April 18, 2010 Author Share Posted April 18, 2010 Oops.. thx. >.> DELETE. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now