Jump to content

Recommended Posts

Posted

I have a problem with setElementTarget recently,
because I would like to make a script in which when I aim at something, "CreateWeapon" will shoot in that direction, but no matter what I do, it shoots too close or crooked. Anyone got any idea for this?

  • Moderators
Posted (edited)
15 hours ago, redditing said:

it shoots too close or crooked.

Do you mean that it is inaccurate in some way? Or do you mean that you want to add spread, but that doesn't work out great?


@redditing

+ You have to keep in mind that bullets created by a default weapon do have a different start point. They are NOT created from the weapon muzzle, but from target start.

That means that if you set the target of the custom weapon to the target end position, the lines between the two weapons will cross at this point, instead of stay next to each other to the infinity-end position.

So maybe try this instead:
https://wiki.multitheftauto.com/wiki/GetPedTargetCollision

 

 

Edited by IIYAMA
more details.
Posted
1 hour ago, IIYAMA said:

Do you mean that it is inaccurate in some way? Or do you mean that you want to add spread, but that doesn't work out great?


@redditing

+ You have to keep in mind that bullets created by a default weapon do have a different start point. They are NOT created from the weapon muzzle, but from target start.

That means that if you set the target of the custom weapon to the target end position, the lines between the two weapons will cross at this point, instead of stay next to each other to the infinity-end position.

So maybe try this instead:
https://wiki.multitheftauto.com/wiki/GetPedTargetCollision

 

 

And this will help me get the positions of the NEAREST target I am aiming for?

  • Moderators
Posted
1 hour ago, redditing said:

And this will help me get the positions of the NEAREST target I am aiming for?

most likely

  • Like 1

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