Skip to content

How to create new classes

Nicholas-Fuchs edited this page May 9, 2020 · 2 revisions
  1. Go to 'zombieplague/gamemode/classes' folder
  2. Go to 'zombies' folder if you want to create a zombie class and 'humans' if you want to create a human class
  3. Create a new .lua file (Example: bomber.lua)
  4. Override ZPClass with a ZPClass Object and change as your will

Example (bomber.lua content):


ZPClass.Name = "ZombieBomberClassName"
ZPClass.Description = "ZombieBomberClassDescription"
ZPClass.MaxHealth = 500
ZPClass.PModel = "models/player/zombie_classic.mdl"
ZPClass.Speed = 240
ZPClass.RunSpeed = 260
ZPClass.CrouchSpeed = 0.4
ZPClass.Gravity = 0.7
ZPClass.Breath = 50
function ZPClass:WeaponGive(ply)
ply:Give(ZOMBIE_KNIFE)
end

ZPClass.Ability = ClassManager:CreateClassAbility(true, function(ply)
local Weap = ply:GetWeapon("weapon_frag")
if IsValid(Weap) then
ply:GiveAmmo(1, Weap:GetPrimaryAmmoType(), true)
else
ply:GiveZombieAllowedWeapon("weapon_frag")
end
end)
ZPClass.Ability.Drain = 120
ZPClass.Ability.MaxAbilityPower = 120

if(ZPClass:ShouldBeEnabled()) then
ClassManager:AddZPClass("BomberZombie", ZPClass, TEAM_ZOMBIES)
end

Clone this wiki locally