itHyperoX Posted June 27, 2019 Posted June 27, 2019 Hi, there is an object which is attached to a player cache['objectAttach'][client] = createObject(id, myX, myY, myZ) attachElements(cache['objectAttach'][client], client, 0, 0, 0) My question is, how can i change the Z cord if it's attached ? i was trying like local x, y, z = getElementPosition(client) newZ = z - 0.05 setElementPosition(cache['objectAttach'][client], x, y, newZ) but i don't think that i can change the attached object pos; any help thanks
Moderators IIYAMA Posted June 27, 2019 Moderators Posted June 27, 2019 2 minutes ago, itHyperoX said: My question is, how can i change the Z cord if it's attached ? https://wiki.multitheftauto.com/wiki/SetElementAttachedOffsets 1 Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
itHyperoX Posted June 27, 2019 Author Posted June 27, 2019 You are the best mate, one more question. How can i decrease / increase with 0.1 the Z player position after the player scrolling ?
Moderators IIYAMA Posted June 27, 2019 Moderators Posted June 27, 2019 2 minutes ago, itHyperoX said: How can i decrease / increase with 0.1 the Z player position after the player scrolling ? By getting your previous values:https://wiki.multitheftauto.com/wiki/GetElementAttachedOffsets With bindkey: https://wiki.multitheftauto.com/wiki/BindKey Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
itHyperoX Posted June 29, 2019 Author Posted June 29, 2019 Nice one thanks. Another question , is there any function, or something to check that is the object is still visible ? I mean when i change the Z pos (to down - ) of the object, i want to stop to the object go under the world
Moderators IIYAMA Posted July 1, 2019 Moderators Posted July 1, 2019 The map editor already has this feature. https://wiki.multitheftauto.com/wiki/ProcessLineOfSight Getting the ground/floor position. https://wiki.multitheftauto.com/wiki/GetElementBoundingBox Getting the object size. The map editor already has this feature. https://wiki.multitheftauto.com/wiki/ProcessLineOfSight Getting the ground/floor position. https://wiki.multitheftauto.com/wiki/GetElementBoundingBox Getting the object size. 1 Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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