Jump to content

Problem with moveObject


X-Tornado

Recommended Posts

I did this script but my object didn't move qhen i type the command : /abrirbase . What's the problem?

puertabase = createObject ( 2933, 2463.39, -1659.11, 14.0203, 0, 0, 270.675 ) 
function puertabaseopen() 
moveObject ( puertabase, 5000, 2463.26, -1650.36, 14.0203 ) 
addCommandHandler ( "abrirbase", puertabaseopen ) 
end 

Sorry for my english. I'm Spanish.

Link to comment

The problem is pretty easy, it's just a little hard to get this in the start.

You're saying to the computer: When function "puertabaseopen" is executed, then move object "puertabase" and add command "abrirbase"

You need the command to execute, while you're creating the command while it's executed. Confusing isn't it? :P

Solution is simple though:

puertabase = createObject ( 2933, 2463.39, -1659.11, 14.0203, 0, 0, 270.675 ) -- Object is being created 
function puertabaseopen() -- Function is being created 
    moveObject ( puertabase, 5000, 2463.26, -1650.36, 14.0203 ) 
end 
addCommandHandler ( "abrirbase", puertabaseopen ) -- Execute function puertabaseopen when "/abrirbase" has been typed 

I hope that should make it a little easier to understand. ;)

Link to comment

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