Tekken Posted February 22, 2015 Author Posted February 22, 2015 setPedControlState Yes but will this work with diferent walking style ?
JR10 Posted February 22, 2015 Posted February 22, 2015 It should, it's exactly like pressing the sprint key on your keyboard.
Tekken Posted February 22, 2015 Author Posted February 22, 2015 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
JR10 Posted February 22, 2015 Posted February 22, 2015 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
JR10 Posted February 22, 2015 Posted February 22, 2015 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
Tekken Posted February 22, 2015 Author Posted February 22, 2015 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 ?
JR10 Posted February 22, 2015 Posted February 22, 2015 Try the same thing but without a walkstyle, perhaps sprint doesn't work with certain walkstyles.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now