I am making a shotgun for my game. What do I need to add to the machinegun script to make it shoot like a shotgun, and where do I add it. Also, I have seen that the pistol's alternate fire does this, but it uses up multiple bullets at once. how do I make it so that it only uses one bullet slot?
To spawn multiple projectiles, use any of the
Code:
weap.projectile.spawnFrom<Barrel/Center/ObjectBone/WeaponBone>MultiSlop(proj_name,count,slop);
functions. (Use either Barrel, Center, ObjectBone or WeaponBone, depending on where you want the bullet to be spawned from.)
Look in the docs under "docs/Scripting/WeaponObject.html". It's explained there.
To make it use up one bullet, use the
Code:
weap.ammo.useAmmo(count);
function, replacing count with the number of bullets you want to use.
You can also find this on the same page in the docs.