Ok, here is a script, i want to know what part is controls the shooting times, and if posible explain how it works. I am new at scripting and i would love some pointers lol. and i am trying to get one to do a rapid fire with a machine gun, instead of steady one shot at a time.
if you would, please copy the code that sets the shooting times and tell me what it should be and explain how it works.
datablock PlayerData(national socialistZombie : PlayerStandardArmor)
{
//category = "Vehicles";
minJetEnergy = 0;
jetEnergyDrain = 0;
canJet = 0;
maxItems = 0; //total number of bricks you can carry
maxWeapons = 0; //this will be controlled by mini-game code
maxTools = 0;
runforce = 100 * 90;
maxForwardSpeed = 8;
maxBackwardSpeed = 8;
maxSideSpeed = 8;
attackpower = 10;
//jumpsound = "ZombieJumpSound";
cameradefaultFOV = 90;
cameraMaxFov = 120;
cameraMinFov = 10;
//minlookangle = -1;
//maxlookangle = -1;
minlookangle = -1.5708;
maxlookangle = 1.5708;
BrickDestroyMaxVolume = 250;
BrickMaxJumpHeight = 20;
uiName = "national socialist";
rideable = true;
canRide = true;
BrickKillRadius = 2;
skinColor = "1 0.79 0.57 1";
FollowAnim = "ArmReadyright";
randomwalk = 1;
aimatplayer = 1;
SpecialAttack = 1;
NoBloodyHands = 1;
DoNotZombify = 1;
chance = 90;
};
function national socialistZombie::SpecialAttack(%this,%onshot)
{
%ran = getrandom(-1,1);
%this.setmovex(%ran);
schedule(0,0,national socialistShootMode,%this);
schedule(500,0,national socialistShootMode,%this);
schedule(1000,0,national socialistShootMode,%this);
schedule(1500,0,national socialistShootMode,%this);
%this.schedule(2000,clearmovex);
}
function national socialistShootMode(%this)
{
if(%this.getstate() !$= "Dead")
{
%this.setimagetrigger(0,1);
%this.setimagetrigger(0,0);
}
}
function national socialistZombie::ondisabled(%this,%obj)
{
parent::ondisabled(%this,%obj);
ZombieDefault::ondisabled(%this,%obj);
}
function national socialistZombie::onCollision(%this, %obj, %col, %fade, %pos, %norm)
{
parent::oncollision(%this, %obj, %col, %fade, %pos, %norm);
ZombieDefault::onCollision(%this, %obj, %col, %fade, %pos, %norm);
}
function national socialistZombie::onMount(%a,%player,%vehicle,%d,%e,%f)
{
ZombieDefault::onMount(%a,%player,%vehicle,%d,%e,%f);
parent::onMount(%a,%player,%vehicle,%d,%e,%f);
}
function national socialistZombie::onUnMount(%a,%player,%vehicle,%d,%e,%f)
{
ZombieDefault::onUnMount(%a,%player,%vehicle,%d,%e,%f);
parent::onUnMount(%a,%player,%vehicle,%d,%e,%f);
}
function national socialistZombie::onAdd(%this,%obj)
{
parent::onAdd(%this,%obj);
ZombieDefault::onAdd(%this,%obj);
//schedule(10,0,national socialistfy,%obj);
schedule(15,0,national socialistfy,%obj);
//schedule(20,0,ghostifybot,%obj);
//%obj.playthread(2,armreadyright);
//%obj.setarmthread(crouch);
%obj.mountimage(gunimage,0);
}
function national socialistfy(%obj)
{
%obj.name = "national socialist";
%obj.chestcolor = "0.72 0.53 0.29 1";
%obj.hatcolor = "0.72 0.53 0.29 1";
%obj.rarmcolor = "0.72 0.53 0.29 1";
%obj.larmcolor = "1 0 0 1";
%obj.hipcolor = "0.2 0.2 0.2 1";
%obj.llegcolor = "0.39 0.19 0 1";
%obj.rlegcolor = "0.39 0.19 0 1";
%obj.chest = "0";
%obj.lhand = "0";
%obj.rhand = "0";
%obj.larm = "0";
%obj.rarm = "0";
%obj.hat = "6";
%obj.accent = "0";
%obj.pack = "0";
%obj.secondpack = "0";
%obj.lleg = "0";
%obj.rleg = "0";
%obj.hip = "0";
GameConnection::ApplyBodyParts(%obj);
GameConnection::ApplyBodyColors(%obj);
%obj.setfacename(smileyblonde);
%obj.setdecalname("mod-suit");
%color = %obj.getdatablock().skincolor;
%obj.setNodecolor($rhand[0], %color);
%obj.setNodecolor($lhand[0], %color);
%obj.setNodecolor("headskin", %color);
//servercmdupdatebodyparts(%obj,6);
}
function servercmdsigheil(%client)
{
%client.player.playthread(1,armreadyright);
%client.player.setarmthread(armattack);
}
function servercmdunsigheil(%client)
{
%client.player.setarmthread(look);
}
package national socialistAttackPackage
{
function ProjectileData::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
if(isobject(%obj.sourceobject) && %obj.sourceobject.getdatablock().getname() $= "national socialistZombie")
{
//schedule(0,0,PropaneTankDamageF,%this,%obj,%col);
%source = %obj.sourceobject;
//echo(%source.getclassname());
//echo(IsInMiniGame(%source));
//echo(IsInSameMinigame(%col,%source));
if(isobject(%obj.sourceobject) && %obj.sourceobject.getclassname() $= "AiPlayer" && IsInMinigame(%obj.sourceobject) && IsInSameMinigame(%col,%source))
{
if(%col.client != 0)
{
%source.cols = %col.client;
}
%col.damage(%obj,0,%obj.getdatablock().directDamage/2,$DamageType::zombiebite);
}
}
parent::onCollision(%this,%obj,%col,%fade,%pos,%normal);
}
};
activatepackage(national socialistAttackPackage);