Jump to content

problem with moveObject function


Kas7

Recommended Posts

Posted (edited)
Why the Object is back to normal after 1000*9
 
Trees =  createObject ( 687, -1430.41699, -2479.06812, 44, 0, 0, 90 )
MarkerTrees = createMarker ( -1430.48157, -2480.47974, 46.21198,"checkpoint",1.2,0,255,0,255)

function MoveTrees(hitElement,matchingDimension)
xT,yT,zT = getElementPosition(Trees)
    moveObject (Trees,1000*9,xT,yT,zT,40,0,0)
end
addEventHandler("onMarkerHit", MarkerTrees, MoveTrees)
Edited by Kas7
  • Like 1

We learn from our mistakes, not from our success
My Discord =>> 
! Kas7 ✮ ?eor?e ♛ ?ae? ✮#9999 { "Or ID" }583260997427658752

Burning Daft Punk GIF

  • Moderators
Posted (edited)

Hmm interesting, I knew that there were objects with strange behaviours but I didn't expect it to be with trees. There is of course the wind animation used by some trees, which might be related to the bug.

 

In that case he can try to freeze the object.

setElementFrozen(Trees, true)

Or if that doesn't work, attach the tree to an element 1 that isn't a tree.

https://wiki.multitheftauto.com/wiki/AttachElements

 

Edited by IIYAMA
  • Like 2

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted (edited)
3 hours ago, Patrick said:

Hi!
It's looks like a bug, or maybe it's a "tree mechanism", and trees always stay vertical.

Here you can see, it's rotated because I can stand on the rotated tree.
image.png.8cbec715f6ea30a5b652e42d1f0c61d6.png

 
 
 
 
 
87/5000
 
 
 
Yes you are right when I modify createObject the same mistake happens
Edited by Kas7
  • Like 1

We learn from our mistakes, not from our success
My Discord =>> 
! Kas7 ✮ ?eor?e ♛ ?ae? ✮#9999 { "Or ID" }583260997427658752

Burning Daft Punk GIF

Posted
2 hours ago, IIYAMA said:

Or if that doesn't work, attach the tree to an element 1 that isn't a tree.

 

yeah that will solve the problem but not gonna fix the function this function need to be fixed

  • Like 2

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

Posted (edited)

 

oh

 

3 hours ago, IIYAMA said:

Hmm interesting, I knew that there were objects with strange behaviours but I didn't expect it to be with trees. There is of course the wind animation used by some trees, which might be related to the bug.

 

In that case he can try to freeze the object.


setElementFrozen(Trees, true)

Or if that doesn't work, attach the tree to an element 1 that isn't a tree.

https://wiki.multitheftauto.com/wiki/AttachElements

 

I replaced the {ID} of the tree to {656} and it worked normally
instead of {687}

Edited by Kas7
  • Like 1
  • Thanks 1

We learn from our mistakes, not from our success
My Discord =>> 
! Kas7 ✮ ?eor?e ♛ ?ae? ✮#9999 { "Or ID" }583260997427658752

Burning Daft Punk GIF

  • Moderators
Posted
22 minutes ago, Kas7 said:

 

oh

 

I replaced the {ID} of the tree to {656} and it worked normally
instead of {687}

 

It must have been an unlucky tree, nature can be ruthless sometimes.  ?

 

  • Haha 1

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted
4 minutes ago, IIYAMA said:

 

It must have been an unlucky tree, nature can be ruthless sometimes.  ?

 

xD
+
Thx for help

We learn from our mistakes, not from our success
My Discord =>> 
! Kas7 ✮ ?eor?e ♛ ?ae? ✮#9999 { "Or ID" }583260997427658752

Burning Daft Punk GIF

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