Jump to content

[HELP][URGENT]Zombie moves


ramkid11

Recommended Posts

Posted

Ok then help me take out those lua and meta files alone for ex

  
--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 ) 
            elseif action == 5 then -- stand still doing nothing 
                setPedAnimation ( ped ) 
                setTimer ( Zomb_Idle, 4000, 1, ped ) 
            end 
        end 
    end 
end 
  
--BEHAVIOUR WHILE CHASING PLAYERS 
function Zomb_chase (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) and getElementData ( ped, "Tx" ) ~= false 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, 2 ) 
                        if action == 1 then 
                            setPedAnimation ( ped ) 
                            triggerClientEvent ( "Zomb_Punch", getRootElement(), ped ) 
                            setTimer ( function (ped) if ( isElement ( ped ) ) then setPedAnimation ( ped, "ped", chaseanim, -1, true, true, true ) end end, 800, 1, ped ) 
                            setTimer ( Zomb_chase, 2000, 1, ped, x, y, z ) 
                        elseif action == 2 then 
                            setPedAnimation ( ped ) 
                            triggerClientEvent ( "Zomb_Jump", getRootElement(), ped ) 
                            setTimer ( Zomb_chase, 3500, 1, ped, x, y, z ) 

Posted

This forum is for help with errors / help in general, not requesting for someone else to do something for you. You should try yourself and if you get stuck, tell us what is your exact problem and maybe someone will help you.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...