I want to modify zday a script
That the zombie random spawn
With the functions the easy zombie and the heavy zombie.
Here my script.
ZombieLimit = get("zombies.MaxZombies")-- HOW MANY ZOMBIES SHOULD EXIST AT MAXIMUM? ZombieStreaming = get("zombies.StreamMethod") -- 1 to constantly stream zombies, 0 to only allow zombies to spawn via createZombie function, 2 to only allow spawning at set spawnpoints ZombiePedSkins = {13,22,56,68,69,70,92,97,105,107,108,127,128,152,162,167,188,206,209,212,229,230,258,264,277,280} --ALTERNATE SKIN LISTS FOR ZOMBIES (SHORTER LIST IS TEXTURED ZOMBIES ONLY) resourceRoot = getResourceRootElement() moancount =0 moanlimit = 10 --- //создаём рандомные классы зомби addEvent( "onRandomfunction" ); addEventHandler( "onRandomfunction", getRootElement(), function( killer ) local headless = math.random (0,3) if headless == 0 then setPedHeadless (zomb,true) end --IDLE BEHAVIOUR OF A ZOMBIE function Zomb_Idle (ped) if isElement(ped) then if ( getElementData ( ped, "status" ) == "idle" ) and ( isPedDead ( ped ) == false ) and (getElementData (ped, "zombie") == true) then local action = math.random( 1, 6) if action < 4 then -- walk a random direction local rdmangle = math.random( 1, 359 ) setPedRotation( ped, rdmangle ) setPedAnimation ( ped, "PED", "Player_Sneak", -1, true, true, true) setTimer ( Zomb_Idle, 7000, 1, ped ) elseif action == 4 then -- get on the ground setPedAnimation ( ped, "MEDIC", "cpr", -1, false, true, true) setTimer ( Zomb_Idle, 4000, 1, ped ) end end end end ----//создаём класс 1 тупые зомби function zomb_class1 (ped, Zx, Zy, Zz ) if isElement(ped) then if (getElementData ( ped, "status" ) == "chasing") and (getElementData (ped, "zombie") == true) then local x, y, z = getElementPosition( ped ) if (getElementData ( ped, "target" ) == nil) then local Px = getElementData ( ped, "Tx" ) local Py = getElementData ( ped, "Ty" ) local Pz = getElementData ( ped, "Tz" ) local Pdistance = (getDistanceBetweenPoints3D( Px, Py, Pz, x, y, z )) if (Pdistance < 1.5 ) then setTimer ( function (ped) if ( isElement ( ped ) ) then setElementData ( ped, "status", "idle" ) end end, 2000, 1, ped ) end end local distance = (getDistanceBetweenPoints3D( x, y, z, Zx, Zy, Zz )) if (distance < 1 ) then -- IF THE PED HASNT MOVED if (getElementData ( ped, "target" ) == nil) then local giveup = math.random( 1, 15 ) if giveup == 1 then setElementData ( ped, "status", "idle" ) else local action = math.random( 1,6 ) if action == 1 then setPedAnimation ( ped ) triggerClientEvent ( "Zomb_Punch", getRootElement(), ped ) setTimer ( function (ped) if ( isElement ( ped ) ) then setPedAnimation ( ped, "ped", "run_old", -1, true, true, true ) end end, 800, 1, ped ) setTimer ( zomb_class1, 2000, 1, ped, x, y, z ) elseif action == 2 then setPedAnimation ( ped ) triggerClientEvent ( "Zomb_Jump", getRootElement(), ped ) setTimer ( zomb_class1, 3500, 1, ped, x, y, z ) end local Ptarget = (getElementData ( ped, "target" )) if isElement(Ptarget) then local Px, Py, Pz = getElementPosition( Ptarget ) local Pdistance = (getDistanceBetweenPoints3D( Px, Py, Pz, Zx, Zy, Zz )) if (Pdistance < 1.2 ) then -- ATTACK A PLAYER IF THEY ARE CLOSE if ( isPedDead ( Ptarget ) ) then --EAT A DEAD PLAYER setPedAnimation ( ped ) setPedAnimation ( ped, "MEDIC", "cpr", -1, false, true, false) setTimer ( function (ped) if ( isElement ( ped ) ) then setElementData ( ped, "status", "idle" ) end end, 10000, 1, ped ) setTimer ( function (ped) if ( isElement ( ped ) ) then setPedRotation ( ped, getPedRotation(ped)-180) end end, 10000, 1, ped ) zmoan(ped) else local action = math.random( 1,6 ) if action == 1 then setPedAnimation ( ped) triggerClientEvent ( "Zomb_Jump", getRootElement(), ped ) setTimer ( zomb_class1, 2000, 1, ped, x, y, z ) else setPedAnimation ( ped) triggerClientEvent ( "Zomb_Punch", getRootElement(), ped ) setTimer ( function (ped) if ( isElement ( ped ) ) then setPedAnimation ( ped, "ped", "run_old", -1, true, true, true ) end end, 800, 1, ped ) setTimer ( zomb_class1, 2000, 1, ped, x, y, z ) end end else if ( isPedDead (Ptarget) ) then setTimer ( function (ped) if ( isElement ( ped ) ) then setElementData ( ped, "status", "idle" ) end end, 2000, 1, ped ) setTimer ( function (ped) if ( isElement ( ped ) ) then setPedRotation ( ped, getPedRotation(ped)-180) end end, 1800, 1, ped ) else local action = math.random( 1,6 ) if action == 1 then setPedAnimation ( ped) triggerClientEvent ( "Zomb_Punch", getRootElement(), ped ) setTimer ( function (ped) if ( isElement ( ped ) ) then setPedAnimation ( ped, "ped", "run_old", -1, true, true, true ) end end, 800, 1, ped ) setTimer ( zomb_class1, 2000, 1, ped, x, y, z ) elseif action == 2 then setPedAnimation ( ped) triggerClientEvent ( "Zomb_Jump", getRootElement(), ped ) setTimer ( zomb_class1, 2000, 1, ped, x, y, z ) end end end else setElementData ( ped, "status", "idle" ) end end else setPedAnimation ( ped, "ped", "run_old", -1, true, true, true) --KEEP WALKING setTimer ( zomb_class1, 1000, 1, ped, x, y, z ) --CHECK AGAIN end end end end end addEvent( "onZombieWasted" ); addEventHandler( "onZombieWasted", getRootElement(), function( killer ) givePlayerMoney( killer, 100 ); if (killer) and (killer ~=source) then local exp = getElementData(killer,"exp") if exp then setElementData(killer,"exp",tonumber(getElementData(killer,"exp"))+5) outputChatBox("+5 exp! всего ".. tonumber(exp)+5,killer,0,255,0) else setElementData(killer,"exp",0) end end end ) ----//создаём класс 2 простые зомби function Zomb_class2 (ped, Zx, Zy, Zz ) if isElement(ped) then if (getElementData ( ped, "status" ) == "chasing") and (getElementData (ped, "zombie") == true) then local x, y, z = getElementPosition( ped ) if (getElementData ( ped, "target" ) == nil) then local Px = getElementData ( ped, "Tx" ) local Py = getElementData ( ped, "Ty" ) local Pz = getElementData ( ped, "Tz" ) local Pdistance = (getDistanceBetweenPoints3D( Px, Py, Pz, x, y, z )) if (Pdistance < 1.5 ) then setTimer ( function (ped) if ( isElement ( ped ) ) then setElementData ( ped, "status", "idle" ) end end, 2000, 1, ped ) end end local distance = (getDistanceBetweenPoints3D( x, y, z, Zx, Zy, Zz )) if (distance < 1 ) then -- IF THE PED HASNT MOVED if (getElementData ( ped, "target" ) == nil) then local giveup = math.random( 1,6 ) if giveup == 1 then setElementData ( ped, "status", "idle" ) else local action = math.random( 1,6 ) if action == 1 then setPedAnimation ( ped ) triggerClientEvent ( "Zomb_Punch2", getRootElement(), ped ) setTimer ( function (ped) if ( isElement ( ped ) ) then setPedAnimation ( ped, "ped", "run_fatold", -1, true, true, true ) end end, 800, 1, ped ) setTimer ( Zomb_class2, 2000, 1, ped, x, y, z ) elseif action == 2 then setPedAnimation ( ped ) triggerClientEvent ( "Zomb_Jump2", getRootElement(), ped ) setTimer ( Zomb_class2, 3500, 1, ped, x, y, z ) end end else local Ptarget = (getElementData ( ped, "target" )) if isElement(Ptarget) then local Px, Py, Pz = getElementPosition( Ptarget ) local Pdistance = (getDistanceBetweenPoints3D( Px, Py, Pz, Zx, Zy, Zz )) if (Pdistance < 1.2 ) then -- ATTACK A PLAYER IF THEY ARE CLOSE if ( isPedDead ( Ptarget ) ) then --EAT A DEAD PLAYER setPedAnimation ( ped ) setPedAnimation ( ped, "MEDIC", "cpr", -1, false, true, false) setTimer ( function (ped) if ( isElement ( ped ) ) then setElementData ( ped, "status", "idle" ) end end, 10000, 1, ped ) setTimer ( function (ped) if ( isElement ( ped ) ) then setPedRotation ( ped, getPedRotation(ped)-180) end end, 10000, 1, ped ) zmoan(ped) else local action = math.random( 1,6 ) if action == 1 then setPedAnimation ( ped) triggerClientEvent ( "Zomb_Jump2", getRootElement(), ped ) setTimer ( Zomb_class2, 2000, 1, ped, x, y, z ) else end end else if ( isPedDead (Ptarget) ) then setTimer ( function (ped) if ( isElement ( ped ) ) then setElementData ( ped, "status", "idle" ) end end, 2000, 1, ped ) setTimer ( function (ped) if ( isElement ( ped ) ) then setPedRotation ( ped, getPedRotation(ped)-180) end end, 1800, 1, ped ) else local action = math.random( 1,6 ) if action == 1 then setPedAnimation ( ped) triggerClientEvent ( "Zomb_Punch2", getRootElement(), ped ) setTimer ( function (ped) if ( isElement ( ped ) ) then setPedAnimation ( ped, "ped", "run_fatold", -1, true, true, true ) end end, 800, 1, ped ) setTimer ( Zomb_class2, 2000, 1, ped, x, y, z ) elseif action == 2 then setPedAnimation ( ped) triggerClientEvent ( "Zomb_Jump2", getRootElement(), ped ) setTimer ( Zomb_class2, 2000, 1, ped, x, y, z ) end end end else setElementData ( ped, "status", "idle" ) end end else setPedAnimation ( ped, "ped", "run_fatold", -1, true, true, true) --KEEP WALKING setTimer ( Zomb_class2, 1000, 1, ped, x, y, z ) --CHECK AGAIN end end end end addEvent( "onZombieWasted2" ); addEventHandler( "onZombieWasted2", getRootElement(), function( killer ) givePlayerMoney( killer, 200 ); if (killer) and (killer ~=source) then local exp = getElementData(killer,"exp") if exp then setElementData(killer,"exp",tonumber(getElementData(killer,"exp"))+10) outputChatBox("+10 exp! всего ".. tonumber(exp)+10,killer,0,255,0) else setElementData(killer,"exp",0) end end end ) ----//создаём класс 3 сложные зомби function Zomb_class3 (ped, Zx, Zy, Zz ) if isElement(ped) then if (getElementData ( ped, "status" ) == "chasing") and (getElementData (ped, "zombie") == true) then local x, y, z = getElementPosition( ped ) if (getElementData ( ped, "target" ) == nil) then local Px = getElementData ( ped, "Tx" ) local Py = getElementData ( ped, "Ty" ) local Pz = getElementData ( ped, "Tz" )