How to make a shotgun Bullet so many Pellets get shot out

Hey guys, i’m wondering how to make a shotgun bullet script, so may shots get fired out.
I’ve been doing researching and I just can’t find anything, Any help would be loved

2 Likes

Whatever you’re currently using for your bullet fire function, wrap that in a for loop so that the fire function gets called n times without any kind of delay between iterations. You can see various examples of this at work in code, such as the Trench Warfare Shotgun gear in the catalog.

3 Likes

On top of what colbert2677 said, you can use math.random for each iteration to get that spread effect from each shot so that the rounds/bullets are not all shooting in the same location.

2 Likes

Have you tried to fire multiple rays out the end of the gun at random orientations? Then you can get the distance of the ray if it hits something and deal damage from there, the further the Humanoid, the less damage.

3 Likes