manve1 Posted December 9, 2012 Share Posted December 9, 2012 I have got a problem, a specific object (( ship )) doesn't move for some reason. And i was wondering why it ain't moving, local ship = createObject( 10771, 105.09999847412, 266.20001220703, 5, 0, 0, 0 ) failureTimer = setTimer( function() if not ( r1 == 0 and g1 == 255 and b1 == 0 ) then setTimer( function() local x1, y1, z1 = getElementPosition( ship ) moveObject( ship, 1000, x1, y1, z1 - 30 ) end, 1000, 0 ) end end, 1000, 1 ) NOTE: Script might make no sense. Link to comment
HunT Posted December 9, 2012 Share Posted December 9, 2012 Remove the local local ship = createObject -- to ship = createObject Link to comment
Anderl Posted December 9, 2012 Share Posted December 9, 2012 What you're saying makes totally no sense, Hunterix. I have got a problem, a specific object (( ship )) doesn't move for some reason. And i was wondering why it ain't moving, local ship = createObject( 10771, 105.09999847412, 266.20001220703, 5, 0, 0, 0 ) failureTimer = setTimer( function() if not ( r1 == 0 and g1 == 255 and b1 == 0 ) then setTimer( function() local x1, y1, z1 = getElementPosition( ship ) moveObject( ship, 1000, x1, y1, z1 - 30 ) end, 1000, 0 ) end end, 1000, 1 ) NOTE: Script might make no sense. It really doesn't make any sense. What are you trying to do? And where are "r1", "g1" and "b1" variables defined? Link to comment
HunT Posted December 9, 2012 Share Posted December 9, 2012 Listen Anderl "facepalm" u want stress me anytime? with the "local" ship = createObject the moveObject not work. Please shut up and no reply anytime with out motive. Link to comment
manve1 Posted December 9, 2012 Author Share Posted December 9, 2012 Still ain't moving it down (( btw, everything is made in the script, the r1, g1, b1, ect .. )) Link to comment
Anderl Posted December 9, 2012 Share Posted December 9, 2012 Listen Anderl "facepalm" u want stress me anytime?with the "local" ship = createObject the moveObject not work. Please shut up and no reply anytime with out motive. It will work, it has nothing to do with being a local variable. Since the variable is declared out of any function or statement it will be a global variable inside the file and won't be shared to other files. Link to comment
manve1 Posted December 9, 2012 Author Share Posted December 9, 2012 The whole ship creating and the timer is in a function, and everything is declared, but it ain't moving the object down Link to comment
Anderl Posted December 9, 2012 Share Posted December 9, 2012 I just tested your script, it works fine: local ship = createObject( 10771, 105.09999847412, 266.20001220703, 5, 0, 0, 0 ); failureTimer = setTimer( function() if ( true and true and true ) then setTimer( function() local x, y, z = getElementPosition( ship ); moveObject( ship, 1000, x, y, z - 30 ); end, 1000, 0 ) end end, 1000, 1 ) Meta.xml: <meta> <script src="script.lua" type="server"/> </meta> Link to comment
Castillo Posted December 9, 2012 Share Posted December 9, 2012 Listen Anderl "facepalm" u want stress me anytime?with the "local" ship = createObject the moveObject not work. Please shut up and no reply anytime with out motive. You are wrong here, and even when he's correcting your mistake, you threat him like this. 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