Zombie Class Problem



  • Hey there guys I got another problem. I have 2 boss classes that are appearing in the regular class menu here are the codes for both classes.

    CLASS.Name = "Juggernaut Form"
    CLASS.TranslationName = "class_jugger"
    CLASS.Description = "description_jugger"
    CLASS.Help = "controls_jugger"
    
    CLASS.Wave = 0
    CLASS.Threshold = 0
    CLASS.Unlocked = true
    CLASS.Hidden = true
    CLASS.Boss = true
    
    CLASS.SWEP = "weapon_zs_jugger"
    CLASS.Model = Model("models/predatorcz/halo/flood/juggernaut.pmd/model.mdl")
    
    CLASS.Health = 1000
    CLASS.Speed = 220
    
    CLASS.Points = 60
    
    CLASS.FearPerInstance = 1
    
    CLASS.Mass = 500
    CLASS.PainSounds = {Sound("flood/tank_yell_16.wav"), Sound("flood/tank_yell_09.wav"), Sound("flood/tank_yell_10.wav"), Sound("flood/tank_yell_07.wav"), Sound("flood/tank_voice_01.wav")}
    CLASS.DeathSounds = {Sound("flood/tank_voice_04.wav"), Sound("flood/tank_voice_03.wav")}
    
    CLASS.JumpPower = 790
    CLASS.Hull = {Vector(-22, -22, 0), Vector(22, 22, 96)}
    CLASS.HullDuck = {Vector(-22, -22, 0), Vector(22, 22, 58)}
    CLASS.ViewOffset = Vector(0, 55, 155)
    CLASS.ViewOffsetDucked = Vector(0, 0, 48)
    
    function CLASS:CanUse(pl)
    	return GAMEMODE:GetDynamicSpawning() and not GAMEMODE.ZombieEscape
    end
    
    function CLASS:Move(pl, mv)
    	local wep = pl:GetActiveWeapon()
    	if wep:IsValid() and wep.IsInAttackAnim and (wep:IsInAttackAnim() or wep:GetHoldingRightClick()) then
    		mv:SetMaxSpeed(0)
    		mv:SetMaxClientSpeed(0)
    
    		return true
    	end
    
    	if mv:GetForwardSpeed() <= 0 then
    		mv:SetMaxSpeed(mv:GetMaxSpeed() * 0.45)
    		mv:SetMaxClientSpeed(mv:GetMaxClientSpeed() * 0.45)
    	end
    end
    
    function CLASS:CalcMainActivity(pl, velocity)
    	if velocity:Length2D() <= 0.5 then
    		pl.CalcIdeal = ACT_IDLE
    	else
    		pl.CalcIdeal = ACT_RUN
    	end
    
    local speed = velocity:Length2D()
    	if not pl:OnGround() or pl:WaterLevel() >= 3 then
    		pl.CalcSeqOverride = pl:LookupSequence("air_leap")
    --	elseif speed <= 0.5 and wep:IsRoaring() then
    --		pl.CalcSeqOverride = pl:LookupSequence("angry_idle")
    	end	
    
    	return true
    end
    
    function CLASS:UpdateAnimation(pl, velocity, maxseqgroundspeed)
    	pl:FixModelAngles(velocity)
    end
    
    function CLASS:DoAnimationEvent(pl, event, data)
    	if event == PLAYERANIMEVENT_ATTACK_PRIMARY then
    		pl:AnimRestartGesture(GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MELEE_ATTACK1, true)
    		return ACT_INVALID
    	end
    end
    
    local mathrandom = math.random
    local StepLeftSounds = {
    	"npc/zombie/foot1.wav",
    	"npc/zombie/foot2.wav"
    }
    local StepRightSounds = {
    	"npc/zombie/foot2.wav",
    	"npc/zombie/foot3.wav"
    }
    function CLASS:PlayerFootstep(pl, vFootPos, iFoot, strSoundName, fVolume, pFilter)
    	if iFoot == 0 then
    
    		pl:EmitSound("footsteps/tank/walk/tank_walk0"..math.random(6)..".wav", 70)
    	end
    
    	if EyePos():Distance(vFootPos) <= 300 then
    		util.ScreenShake(vFootPos, 5, 5, 1, 300)
    	end
    
    	return true
    end
    
    if not CLIENT then return end
    
    --CLASS.Icon = "zombiesurvival/killicons/flesh_creeper"
    
    function CLASS:PostPlayerDraw(pl)
    	render.ModelMaterialOverride()
    end
    
    function CLASS:ShouldDrawLocalPlayer()
    	return true
    end
    
    
    CLASS.Name = "Tank"
    CLASS.TranslationName = "class_tank"
    CLASS.Description = "description_tank"
    CLASS.Help = "controls_tank"
    
    CLASS.Wave = 0
    CLASS.Threshold = 0
    CLASS.Unlocked = true
    CLASS.Hidden = true
    CLASS.Boss = true
    
    CLASS.Health = 3000
    CLASS.SWEP = "weapon_zs_tank"
    CLASS.Model = Model("models/enhanced_infected/hulk_1.mdl")
    
    CLASS.Speed = 220
    
    CLASS.Points = 60
    
    CLASS.VoicePitch = 0.55
    CLASS.Mass = 500
    CLASS.PainSounds = {Sound("tank/voice/pain/tank_pain_01.wav"), Sound("tank/voice/pain/tank_pain_02.wav"), Sound("tank/voice/pain/tank_pain_03.wav"), Sound("tank/voice/pain/tank_pain_04.wav"), Sound("tank/voice/pain/tank_pain_05.wav")}
    CLASS.DeathSounds = {Sound("tank/voice/die/tank_death_01.wav"), Sound("tank/voice/die/tank_death_02.wav"), Sound("tank/voice/die/tank_death_03.wav"), Sound("tank/voice/die/tank_death_04.wav"), Sound("tank/voice/die/tank_death_05.wav"), Sound("tank/voice/die/tank_death_06.wav"), Sound("tank/voice/die/tank_death_07.wav")}
    
    CLASS.JumpPower = 180
    CLASS.Hull = {Vector(-22, -22, 0), Vector(22, 22, 96)}
    CLASS.HullDuck = {Vector(-22, -22, 0), Vector(22, 22, 58)}
    CLASS.ViewOffset = Vector(0, 0, 75)
    CLASS.ViewOffsetDucked = Vector(0, 0, 48)
    
    function CLASS:CanUse(pl)
    	return GAMEMODE:GetDynamicSpawning() and not GAMEMODE.ZombieEscape
    end
    
    function CLASS:CalcMainActivity(pl, velocity)
    	local wep = pl:GetActiveWeapon()
    	if wep:IsValid() and wep.GetBurrowTime then
    		local time = wep:GetBurrowTime()
    		if time > 0 then
    			pl.CalcSeqOverride = 11
    			return true
    		elseif time < 0 then
    			pl.CalcSeqOverride = 10
    			return true
    		end
    	end
    
    	if pl:OnGround() then
    		if velocity:Length2D() > 0.5 then
    			pl.CalcSeqOverride = pl:LookupSequence("Run_4")
    		else
    			pl.CalcSeqOverride = 1
    		end
    	elseif pl:WaterLevel() >= 3 then
    		pl.CalcSeqOverride = 4
    	else
    		pl.CalcSeqOverride = 3
    	end
    
    	return true
    end
    
    function CLASS:UpdateAnimation(pl, velocity, maxseqgroundspeed)
    	pl:FixModelAngles(velocity)
    
    	local seq = pl:GetSequence()
    	if seq == 5 then
    		if not pl.m_PrevFrameCycle then
    			pl.m_PrevFrameCycle = true
    			pl:SetCycle(0)
    		end
    
    		pl:SetPlaybackRate(0.9)
    
    		return true
    	elseif pl.m_PrevFrameCycle then
    		pl.m_PrevFrameCycle = nil
    	end
    
    	local len2d = velocity:Length2D()
    	if len2d > 0.5 then
    		pl:SetPlaybackRate(0.9)
    
    	return true
    	end
    end
    function CLASS:DoAnimationEvent(pl, event, data)
    	if event == PLAYERANIMEVENT_ATTACK_PRIMARY then
    		return ACT_INVALID
    	end
    end
    
    local mathrandom = math.random
    local StepLeftSounds = {
    	"npc/zombie/foot1.wav",
    	"npc/zombie/foot2.wav"
    }
    local StepRightSounds = {
    	"npc/zombie/foot2.wav",
    	"npc/zombie/foot3.wav"
    }
    function CLASS:PlayerFootstep(pl, vFootPos, iFoot, strSoundName, fVolume, pFilter)
    	if iFoot == 0 then
    
    		pl:EmitSound("footsteps/tank/walk/tank_walk0"..math.random(6)..".wav", 70)
    	end
    
    	if EyePos():Distance(vFootPos) <= 300 then
    		util.ScreenShake(vFootPos, 5, 5, 1, 300)
    	end
    
    	return true
    end
    
    if not CLIENT then return end
    
    --CLASS.Icon = "zombiesurvival/killicons/flesh_creeper"
    
    function CLASS:PostPlayerDraw(pl)
    	render.ModelMaterialOverride()
    end
    
    function CLASS:ShouldDrawLocalPlayer()
    	return true
    end
    
    


  • Hey there guys I got another problem. I have 2 boss classes that are appearing in the regular class menu here are the codes for both classes.

    CLASS.Name = "Juggernaut Form"
    CLASS.TranslationName = "class_jugger"
    CLASS.Description = "description_jugger"
    CLASS.Help = "controls_jugger"
    
    CLASS.Wave = 0
    CLASS.Threshold = 0
    CLASS.Unlocked = true
    CLASS.Hidden = true
    CLASS.Boss = true
    
    CLASS.SWEP = "weapon_zs_jugger"
    CLASS.Model = Model("models/predatorcz/halo/flood/juggernaut.pmd/model.mdl")
    
    CLASS.Health = 1000
    CLASS.Speed = 220
    
    CLASS.Points = 60
    
    CLASS.FearPerInstance = 1
    
    CLASS.Mass = 500
    CLASS.PainSounds = {Sound("flood/tank_yell_16.wav"), Sound("flood/tank_yell_09.wav"), Sound("flood/tank_yell_10.wav"), Sound("flood/tank_yell_07.wav"), Sound("flood/tank_voice_01.wav")}
    CLASS.DeathSounds = {Sound("flood/tank_voice_04.wav"), Sound("flood/tank_voice_03.wav")}
    
    CLASS.JumpPower = 790
    CLASS.Hull = {Vector(-22, -22, 0), Vector(22, 22, 96)}
    CLASS.HullDuck = {Vector(-22, -22, 0), Vector(22, 22, 58)}
    CLASS.ViewOffset = Vector(0, 55, 155)
    CLASS.ViewOffsetDucked = Vector(0, 0, 48)
    
    function CLASS:CanUse(pl)
    	return GAMEMODE:GetDynamicSpawning() and not GAMEMODE.ZombieEscape
    end
    
    function CLASS:Move(pl, mv)
    	local wep = pl:GetActiveWeapon()
    	if wep:IsValid() and wep.IsInAttackAnim and (wep:IsInAttackAnim() or wep:GetHoldingRightClick()) then
    		mv:SetMaxSpeed(0)
    		mv:SetMaxClientSpeed(0)
    
    		return true
    	end
    
    	if mv:GetForwardSpeed() <= 0 then
    		mv:SetMaxSpeed(mv:GetMaxSpeed() * 0.45)
    		mv:SetMaxClientSpeed(mv:GetMaxClientSpeed() * 0.45)
    	end
    end
    
    function CLASS:CalcMainActivity(pl, velocity)
    	if velocity:Length2D() <= 0.5 then
    		pl.CalcIdeal = ACT_IDLE
    	else
    		pl.CalcIdeal = ACT_RUN
    	end
    
    local speed = velocity:Length2D()
    	if not pl:OnGround() or pl:WaterLevel() >= 3 then
    		pl.CalcSeqOverride = pl:LookupSequence("air_leap")
    --	elseif speed <= 0.5 and wep:IsRoaring() then
    --		pl.CalcSeqOverride = pl:LookupSequence("angry_idle")
    	end	
    
    	return true
    end
    
    function CLASS:UpdateAnimation(pl, velocity, maxseqgroundspeed)
    	pl:FixModelAngles(velocity)
    end
    
    function CLASS:DoAnimationEvent(pl, event, data)
    	if event == PLAYERANIMEVENT_ATTACK_PRIMARY then
    		pl:AnimRestartGesture(GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_MELEE_ATTACK1, true)
    		return ACT_INVALID
    	end
    end
    
    local mathrandom = math.random
    local StepLeftSounds = {
    	"npc/zombie/foot1.wav",
    	"npc/zombie/foot2.wav"
    }
    local StepRightSounds = {
    	"npc/zombie/foot2.wav",
    	"npc/zombie/foot3.wav"
    }
    function CLASS:PlayerFootstep(pl, vFootPos, iFoot, strSoundName, fVolume, pFilter)
    	if iFoot == 0 then
    
    		pl:EmitSound("footsteps/tank/walk/tank_walk0"..math.random(6)..".wav", 70)
    	end
    
    	if EyePos():Distance(vFootPos) <= 300 then
    		util.ScreenShake(vFootPos, 5, 5, 1, 300)
    	end
    
    	return true
    end
    
    if not CLIENT then return end
    
    --CLASS.Icon = "zombiesurvival/killicons/flesh_creeper"
    
    function CLASS:PostPlayerDraw(pl)
    	render.ModelMaterialOverride()
    end
    
    function CLASS:ShouldDrawLocalPlayer()
    	return true
    end
    
    
    CLASS.Name = "Tank"
    CLASS.TranslationName = "class_tank"
    CLASS.Description = "description_tank"
    CLASS.Help = "controls_tank"
    
    CLASS.Wave = 0
    CLASS.Threshold = 0
    CLASS.Unlocked = true
    CLASS.Hidden = true
    CLASS.Boss = true
    
    CLASS.Health = 3000
    CLASS.SWEP = "weapon_zs_tank"
    CLASS.Model = Model("models/enhanced_infected/hulk_1.mdl")
    
    CLASS.Speed = 220
    
    CLASS.Points = 60
    
    CLASS.VoicePitch = 0.55
    CLASS.Mass = 500
    CLASS.PainSounds = {Sound("tank/voice/pain/tank_pain_01.wav"), Sound("tank/voice/pain/tank_pain_02.wav"), Sound("tank/voice/pain/tank_pain_03.wav"), Sound("tank/voice/pain/tank_pain_04.wav"), Sound("tank/voice/pain/tank_pain_05.wav")}
    CLASS.DeathSounds = {Sound("tank/voice/die/tank_death_01.wav"), Sound("tank/voice/die/tank_death_02.wav"), Sound("tank/voice/die/tank_death_03.wav"), Sound("tank/voice/die/tank_death_04.wav"), Sound("tank/voice/die/tank_death_05.wav"), Sound("tank/voice/die/tank_death_06.wav"), Sound("tank/voice/die/tank_death_07.wav")}
    
    CLASS.JumpPower = 180
    CLASS.Hull = {Vector(-22, -22, 0), Vector(22, 22, 96)}
    CLASS.HullDuck = {Vector(-22, -22, 0), Vector(22, 22, 58)}
    CLASS.ViewOffset = Vector(0, 0, 75)
    CLASS.ViewOffsetDucked = Vector(0, 0, 48)
    
    function CLASS:CanUse(pl)
    	return GAMEMODE:GetDynamicSpawning() and not GAMEMODE.ZombieEscape
    end
    
    function CLASS:CalcMainActivity(pl, velocity)
    	local wep = pl:GetActiveWeapon()
    	if wep:IsValid() and wep.GetBurrowTime then
    		local time = wep:GetBurrowTime()
    		if time > 0 then
    			pl.CalcSeqOverride = 11
    			return true
    		elseif time < 0 then
    			pl.CalcSeqOverride = 10
    			return true
    		end
    	end
    
    	if pl:OnGround() then
    		if velocity:Length2D() > 0.5 then
    			pl.CalcSeqOverride = pl:LookupSequence("Run_4")
    		else
    			pl.CalcSeqOverride = 1
    		end
    	elseif pl:WaterLevel() >= 3 then
    		pl.CalcSeqOverride = 4
    	else
    		pl.CalcSeqOverride = 3
    	end
    
    	return true
    end
    
    function CLASS:UpdateAnimation(pl, velocity, maxseqgroundspeed)
    	pl:FixModelAngles(velocity)
    
    	local seq = pl:GetSequence()
    	if seq == 5 then
    		if not pl.m_PrevFrameCycle then
    			pl.m_PrevFrameCycle = true
    			pl:SetCycle(0)
    		end
    
    		pl:SetPlaybackRate(0.9)
    
    		return true
    	elseif pl.m_PrevFrameCycle then
    		pl.m_PrevFrameCycle = nil
    	end
    
    	local len2d = velocity:Length2D()
    	if len2d > 0.5 then
    		pl:SetPlaybackRate(0.9)
    
    	return true
    	end
    end
    function CLASS:DoAnimationEvent(pl, event, data)
    	if event == PLAYERANIMEVENT_ATTACK_PRIMARY then
    		return ACT_INVALID
    	end
    end
    
    local mathrandom = math.random
    local StepLeftSounds = {
    	"npc/zombie/foot1.wav",
    	"npc/zombie/foot2.wav"
    }
    local StepRightSounds = {
    	"npc/zombie/foot2.wav",
    	"npc/zombie/foot3.wav"
    }
    function CLASS:PlayerFootstep(pl, vFootPos, iFoot, strSoundName, fVolume, pFilter)
    	if iFoot == 0 then
    
    		pl:EmitSound("footsteps/tank/walk/tank_walk0"..math.random(6)..".wav", 70)
    	end
    
    	if EyePos():Distance(vFootPos) <= 300 then
    		util.ScreenShake(vFootPos, 5, 5, 1, 300)
    	end
    
    	return true
    end
    
    if not CLIENT then return end
    
    --CLASS.Icon = "zombiesurvival/killicons/flesh_creeper"
    
    function CLASS:PostPlayerDraw(pl)
    	render.ModelMaterialOverride()
    end
    
    function CLASS:ShouldDrawLocalPlayer()
    	return true
    end
    
    


  • Bump


  • Administrators

    Why bump a topic that’s been up for 2 days? This subforum isn’t that fast moving.

    As long as you have these they should be hidden.
    CLASS.Wave = 0
    CLASS.Threshold = 0
    CLASS.Unlocked = true
    CLASS.Hidden = true
    CLASS.Boss = true



  • Its odd both classes have all the code neccesary to make i hidden as a boss. Ill look into the code again


Log in to reply
 

11
Online

10978
Users

15258
Topics

297336
Posts

Looks like your connection to NoXiousNet was lost, please wait while we try to reconnect.