%vector = %obj.getMuzzleVector(%slot); //the direction the gun is pointing Correct
%objectVelocity = %obj.getVelocity(); // if you're moving, the bullets will move differently Partly, yes
%vector1 = VectorScale(%vector, %projectile.muzzleVelocity); //points the bullets the right way...? Makes a gun bullet move faster than a rocket, a sniper go fast. The speed of the projectile.
%vector2 = VectorScale(%objectVelocity, %projectile.velInheritFactor); //no clue Calculations for below
%velocity = VectorAdd(%vector1,%vector2); //used later on That makes the bullets move differently when you move
%x = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%y = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%z = (getRandom() - 0.5) * 10 * 3.1415926 * %spread; //these three are aiming the bullets randomly The 3.14 bits are making it a circle so you end up with a random round spread
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z); //Whut? Turns those three co-ordinates into a matrix
%velocity = MatrixMulVector(%mat, %velocity); //The bullet speed Aims the bullets slightly off from the velocity calculated above and the random spread matrix
function timedmg(%col,%amount,%type,%timer,%maxtime)
{
if(%col.getClassName() $= "Player" && %col.getState() !$= "Dead" && isObject(%col.client.minigame)){
%col.damage(%col, "Head", %amount, %type);
%col.burn(1000);
%col.psnamount = %col.psnamount + $FireSpeed;
if(%col.psnamount < %maxtime){
%col.psn=schedule($FireSpeed,0,"timedmg",%col,%amount,%type,%timer,%maxtime);}}
}
The TimeDmg() function used in the Weapon Ammo mod. It does damage over time until a set amount of time has passed. Ideally it should check whether you are both in the same minigame and whether the player is a bot, but I forgot to. Explainationism:
function timedmg(%col,%amount,%type,%timer,%maxtime)
{
if(You Are A Player && You Aren't Dead && You Are In A Minigame){
Damage You For [amount] damage of 'death type' [type]
Burn effect for a second
Add a set amount to your 'Burn Time'
if(Burn Time < Max Time){
Do Function Again After a Set Amount of Time}}
}