It works, however each bullet has the same spread so it shows up as one bullet, when in reality it’s 8 different bullets occupying the same space. How do I make the bullet spread random for each individual bullet?
@Kampfkarren I’m having issues where it shoots fine, but does no damage to the character, but when you go up close, it shoots one bullet and does some damage to the character. Any idea why?
You’re calling return inside your loop, which stops the loop entirely. Move the code to a function and call the function from the loop. (By the way, your code is entirely insecure and a hacker can call your DAMAGEOBJECT from their client and kill everyone in the game, do your code on the server and not the client).
Will do, and yes I just need this so it can be functional, there’s not many people who will bother doing it and those who do get banned easily because of the small server size of my group game.
After I move the code, the only thing in the for loop should be the function correct?
Also to clarify do I keep return inside the function or remove it?
The shotgun isn’t doing damage from further than 2-3 studs, and it also shows the weird behaviour above. Any idea why? I think each bullet isn’t doing damage, either it insta-kills, or does no damage, it’s being inconsistent.
Maybe something a little more sophisticated than this, particularly if you are going to show where the pellets hit. Just adding random numbers to the aim point will give you a uniform distribution, over a square. What you want, typically, is a circular distribution with gaussian weighting or some approximation thereof.