Jump to content

Problem


manve1

Recommended Posts

Posted

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.

Posted

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?

Posted

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.

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

Posted

The whole ship creating and the timer is in a function, and everything is declared, but it ain't moving the object down

Posted

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> 
  

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

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