Jump to content

Hitting an object


AMARANT

Recommended Posts

Posted

Hello there. Is there a function or some other way to check hitting or punching an object? For example, I want to check if I hit a specific box with my hands. Thanks in advance for answers.

Posted (edited)

I don't think you can check for hand contact with elements in MTA, if there is, it's too hard for a beginner ( unless you already have a good base in maths and even so you would need lil LUA knowledge ).

Edited by Guest

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

Posted

I noticed this new function recently. I don't use 1.4 MTA version yet, so I wonder if that function might be a solution of my problem? Has anybody checked it?

Posted

There's no way to know if it was hand contact with that event, it just gets triggered when some element hits an object.

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

  • Moderators
Posted

There are some possibility's, but they aren't just one function.

https://wiki.multitheftauto.com/wiki/GetPedBonePosition

This means you can pick some positions of the human body.

https://wiki.multitheftauto.com/wiki/ProcessLineOfSight

processLineOfSight(startX,startY,startZ,endX,endY,endZ,true,true,true,true,true,false,false,false,ignorePlayer)) 

IgnorePlayer must be you,

https://wiki.multitheftauto.com/wiki/OnClientRender

Use onClientRender to check those data.

This is a possibility, good luck.

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

 

  Useful functions  3x 

  Tutorials  4x 

 

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