alexis1999 Posted June 26, 2012 Share Posted June 26, 2012 Hello, I tried creating an object that moves repeatedly apparently when I debug it and compile it on the test server the elevator does not move. It just stays frozen. My script local elevator = createObject ( 971, 3226.3999023438, -2897.3999023438, 15.60000038147, 89.249816894531, 180, 231.75024414063 ) i=0 function () while i!=-1 do moveObject(elevator, 10000, 3226.3999023438, -2897.3999023438, 29.60000038147, 89.249816894531, 180, 231.75024414063 ) setTimer (moveObject, 10000, 1, elevator, 1000, 3226.3999023438, -2897.3999023438, 15.60000038147 ) end end P.S Was not sure for the while i integer. In Java it would work. My point was to loop the script until the map stops Please let me know If I did something wrong with placing coordinates or something other Here are original unedited coordinates Elevator Down: Elevator Up: Thanks! Link to comment
Castillo Posted June 26, 2012 Share Posted June 26, 2012 local elevator = createObject ( 971, 3226.3999023438, -2897.3999023438, 15.60000038147, 89.249816894531, 180, 231.75024414063 ) moveObject ( elevator, 10000, 3226.3999023438, -2897.3999023438, 29.60000038147, 89.249816894531, 180, 231.75024414063 ) setTimer ( moveObject, 10000, 1, elevator, 1000, 3226.3999023438, -2897.3999023438, 15.60000038147 ) There's no need for a "while". Link to comment
alexis1999 Posted June 26, 2012 Author Share Posted June 26, 2012 Thanks for replying! It works perfectly but the only issue is that it does move up and down once instead I wanted it to move up-down until the end of the map Link to comment
Castillo Posted June 26, 2012 Share Posted June 26, 2012 What do you mean by "end of the map"? do you mean like until round ends? if so, just put that script inside your map folder and it'll stop when the map changes. Link to comment
alexis1999 Posted June 26, 2012 Author Share Posted June 26, 2012 I did try but it only moves 1 time and then becames frozen Also I have found another issue. When it starts move up it rotates automatic in a random coordinate, I'm pretty sure the rotation coordinates I wrote were correct since I deleted and rewrited the coordinates again after seeing it was bugged. I recorded what exactly happens ( Also shows that it stucks ) Link to comment
Mega9 Posted June 26, 2012 Share Posted June 26, 2012 local elevator = createObject ( 971, 3226.3999023438, -2897.3999023438, 15.60000038147, 89.249816894531, 180, 231.75024414063 ) moveObject ( elevator, 10000, 3226.3999023438, -2897.3999023438, 29.60000038147 ) -- the last three arguments were causing the rotation problem setTimer ( moveObject, 10000, 1, elevator, 1000, 3226.3999023438, -2897.3999023438, 15.60000038147 ) 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