1. Post #1
    StormAlt's Avatar
    June 2008
    17 Posts
    Hi, I'm trying to change a zombie survival fast zombie class so that it picks a random model each time someone plays it.

    Heres the code

    RegisterZombieClass("Fast Zombie",
    {
    Name = "Fast Zombie",
    Wave = 0, -- The decimal is a percent of the total waves. Example, this would be wave 3 in a game with 10 waves total. Always rounded down.
    Health = 175,
    SWEP = "weapon_zs_fastzombie",
    Model = Model("models/Zombie/Fast.mdl"),
    Speed = 310,
    Description = "A very fast, heavily decomposed undead cadaver.@Unique abilities: Can climb walls and lunge at its victims.",
    PainSounds = {
    Sound("npc/fast_zombie/leap1.wav"),
    Sound("npc/fast_zombie/wake1.wav")
    },
    DeathSounds = {
    Sound("npc/fast_zombie/fz_alert_close1.wav")
    },
    PlayerFootstep = true
    })

  2. Post #2
    schumacher's Avatar
    June 2008
    600 Posts
    Try something around the lines of...

    function PickTehShit(ply)

    local MODELRAND = (Math.Rand( 1, 3))
    local 1 = ""
    local 2 = ""
    local 3 = ""
    If (ply:Team() == "TEAM NAME") then
    (ply:SetModel( MODELRAND )
    end

    It's really late were i am, Use that for an idea, But I'm going to sleep now, so. The reason it's so sloppy is because it's only for an idea, and its very late, Night!
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 1Disagree Disagree x 1 (list)

  3. Post #3
    Gold Member
    Jamie932's Avatar
    July 2008
    2,590 Posts
    Try something around the lines of...

    function PickTehShit(ply)

    local MODELRAND = (Math.Rand( 1, 3))
    local 1 = ""
    local 2 = ""
    local 3 = ""
    If (ply:Team() == "TEAM NAME") then
    (ply:SetModel( MODELRAND )
    end
    Eurgh.

    Playermodelz = {}
    Playermodelz[1] = "models/player/breen.mdl"
    Playermodelz[2] = "nextmodel"
    Playermodelz[3] = "nextmodel"
    
    function RandomPlayermodel( ply )
    
    if ply:Team() == "Team Name Here" then
    ply:SetModel( table.Random(Playermodelz) )
    
    end
    
    hook.Add("PlayerSpawn", "Randomplayermodel", RandomPlayermodel)

    I know there is a hook on which to change the playermodel, Just cant remember its name.
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Dumb Dumb x 1Agree Agree x 1 (list)

  4. Post #4

    September 2009
    19 Posts
    Have you tried doing something like

    RegisterZombieClass("Fast Zombie",
    {
    Name = "Fast Zombie",
    Wave = 0, -- The decimal is a percent of the total waves. Example, this would be wave 3 in a game with 10 waves total. Always rounded down.
    Health = 175,
    SWEP = "weapon_zs_fastzombie",
    
    zombiemodels = { "models/here", "etc", "etc" }
    
    Model = Model( table.Random( zombiemodels ) )
    Speed = 310,
    Description = "A very fast, heavily decomposed undead cadaver.@Unique abilities: Can climb walls and lunge at its victims.",
    PainSounds = {
    Sound("npc/fast_zombie/leap1.wav"),
    Sound("npc/fast_zombie/wake1.wav")
    },
    DeathSounds = {
    Sound("npc/fast_zombie/fz_alert_close1.wav")
    },
    PlayerFootstep = true
    })

  5. Post #5
    schumacher's Avatar
    June 2008
    600 Posts
    There ya go, Take it from those guys, It was like 4:00 AM were i was, I couldn't think straight.

  6. Post #6
    StormAlt's Avatar
    June 2008
    17 Posts
    Have you tried doing something like

    RegisterZombieClass("Fast Zombie",
    {
    Name = "Fast Zombie",
    Wave = 0, -- The decimal is a percent of the total waves. Example, this would be wave 3 in a game with 10 waves total. Always rounded down.
    Health = 175,
    SWEP = "weapon_zs_fastzombie",
    
    zombiemodels = { "models/here", "etc", "etc" }
    
    Model = Model( table.Random( zombiemodels ) )
    Speed = 310,
    Description = "A very fast, heavily decomposed undead cadaver.@Unique abilities: Can climb walls and lunge at its victims.",
    PainSounds = {
    Sound("npc/fast_zombie/leap1.wav"),
    Sound("npc/fast_zombie/wake1.wav")
    },
    DeathSounds = {
    Sound("npc/fast_zombie/fz_alert_close1.wav")
    },
    PlayerFootstep = true
    })
    Thanks, it worked.