ArmyOfTwo Posted August 2, 2010 Share Posted August 2, 2010 Hi, i am very beginner in lua! function ShowBuilding( ) local sx,sy,x,y,z = getCursorPosition ( ) local object = createObject (3596,x, y, z+299, 90, 0, 0) ox, oy, oz = getElementPosition(object) gz = getGroundPosition( ox, oy, oz ) createObject (3596,x, y, gz, 90+90, 0, 0) destroyElement( object ) end It creates the object but in wrong x, y coordinates! When i drive around where it's supposed to be created its competely in different location than my cursos was! Please help me! Link to comment
50p Posted August 2, 2010 Share Posted August 2, 2010 You don't need to create an object then get its position and then get ground possition. Just use getGroundPosition( x, y, z ). When is this function called? Link to comment
ArmyOfTwo Posted August 2, 2010 Author Share Posted August 2, 2010 The problem is that if i don't use it like that , the object gets created under the ground! 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