kieran Posted July 2, 2017 Share Posted July 2, 2017 So I been messing with peds movement and can't seem to figure out what I'm doing wrong... Basically I am trying to make a simple script that makes a local ped run in a big square... function forwards() local x, y, z = getElementPosition(localPlayer) local myPed = createPed(0, x + 1, y, z) if myPed then setPedControlState(myPed,"forwards", true) setTimer ( function () setPedControlState(myPed,"forwards", false) --if this line is taken out he runs diagonal setPedControlState(myPed,"right", true) end, 10000, 1 ) --trying to set it on timers setTimer ( function () setPedControlState(myPed,"backwards", true) --problem making him go backwards, he runs diagonally and if right is false here it doesn't work end, 10000, 1 ) end end addCommandHandler("ped",forwards) --command since I am testing just now Is the problem that I don't have anything to check if control state is true or false? Link to comment
DNL291 Posted July 3, 2017 Share Posted July 3, 2017 What are you trying to do exactly? By looking at the code, it looks like you're making the ped go backwards at the same time he should go to the right. Link to comment
kieran Posted July 4, 2017 Author Share Posted July 4, 2017 So I should set right to false on third controlstate? Basically trying to make a ped automatically move clientside... So trying to time the control states and make him run round Link to comment
Moderators IIYAMA Posted July 4, 2017 Moderators Share Posted July 4, 2017 Use: setPedCameraRotation 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