Jump to content

How do i make ped's sprint ?


Tekken

Recommended Posts

I used this for making them walk :

function setPedZombiWalk() 
    for i,ped in ipairs(getElementsByType("ped")) do 
        local zombi = getElementData(ped,"zombie") 
        if zombi then  
            setPedWalkingStyle(ped, 120) 
        end 
    end     
end 

and this for sprint and didn't work:

function setPedZombiSprint() 
    for i,ped in ipairs(getElementsByType("ped")) do 
        local zombi = getElementData(ped,"zombie") 
        if zombi then  
            setPedControlState(ped, "sprint", true) 
        end 
    end 
end 

Walking style is OLDMAN and walk ok but didn't sprint

Link to comment

You need to make the ped walk first.

  
function setPedZombiSprint() 
    for i,ped in ipairs(getElementsByType("ped")) do 
        local zombi = getElementData(ped,"zombie") 
        if zombi then 
            setPedControlState (ped, "forwards", true) 
            setPedControlState(ped, "sprint", true) 
        end 
    end 
end 

Link to comment

My bad, it's forwards not walk, try this:

  
function setPedZombiSprint() 
    for i,ped in ipairs(getElementsByType("ped")) do 
        local zombi = getElementData(ped,"zombie") 
        if zombi then 
            setPedControlState (ped, "forwards", true) 
            setPedControlState(ped, "sprint", true) 
        end 
    end 
end 

Link to comment
My bad, it's forwards not walk, try this:
  
function setPedZombiSprint() 
    for i,ped in ipairs(getElementsByType("ped")) do 
        local zombi = getElementData(ped,"zombie") 
        if zombi then 
            setPedControlState (ped, "forwards", true) 
            setPedControlState(ped, "sprint", true) 
        end 
    end 
end 

Still not working..

They walk but not sprint.

Is there any way to force them sprint ?

Link to comment

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...