Author Topic: CreateBullet direction  (Read 923 times)

0 Members and 1 Guest are viewing this topic.

Offline DevilX4

  • Major(1)
  • Posts: 30
CreateBullet direction
« on: May 06, 2012, 03:17:43 pm »
Hi all,

Does anyone have a script (or part of) that fires a bullet from your player towards/at the nearest player?
I have been wrecking my brain around how to do it.

Thanks for any help given!

EDIT: By the way, I've got the 'nearest player' code, its just the firing the CreateBullet towards the enemy that I don't have.
« Last Edit: May 06, 2012, 03:21:14 pm by DevilX4 »

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: CreateBullet direction
« Reply #1 on: May 06, 2012, 06:23:42 pm »
I wrote a function called DirBullet a while back, you can find it in this thread: http://forums.soldat.pl/index.php?topic=36984.msg449315#msg449315.


Offline tk

  • Soldier
  • **
  • Posts: 235
Re: CreateBullet direction
« Reply #2 on: May 07, 2012, 01:46:05 am »
This will not work well, since bullet is influenced by gravity and air resistance.

Instead, you should use Ballistic aim

You can find a code example in that topic, presenting how to shoot a bullet from one player to another one using that function
« Last Edit: May 07, 2012, 01:47:52 am by tk »

Offline DevilX4

  • Major(1)
  • Posts: 30
Re: CreateBullet direction
« Reply #3 on: May 08, 2012, 06:08:30 pm »
Thanks very much to both of you!