Tekken Posted February 22, 2015 Share Posted February 22, 2015 How do i make ped's sprint ? Link to comment
Tekken Posted February 22, 2015 Author Share Posted February 22, 2015 setPedControlState Yes but will this work with diferent walking style ? Link to comment
JR10 Posted February 22, 2015 Share Posted February 22, 2015 It should, it's exactly like pressing the sprint key on your keyboard. Link to comment
Tekken Posted February 22, 2015 Author Share 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 Link to comment
JR10 Posted February 22, 2015 Share 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 Link to comment
Tekken Posted February 22, 2015 Author Share Posted February 22, 2015 Still didn't work Link to comment
JR10 Posted February 22, 2015 Share 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 Link to comment
Tekken Posted February 22, 2015 Author Share 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 ? Link to comment
JR10 Posted February 22, 2015 Share Posted February 22, 2015 Try the same thing but without a walkstyle, perhaps sprint doesn't work with certain walkstyles. Link to comment
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