DiGiTal Posted December 30, 2019 Posted December 30, 2019 Hi, i want to make my player running fast but it didn't once jump it going from the air like a arrow function updateCamera () local xs, ys, zs = getElementVelocity(localPlayer) setElementVelocity(localPlayer, xs*2, ys*2, zs*2) end addEventHandler ( "onClientPreRender", root, updateCamera ) Our Website : https://tutoplayfun.ml/ Our Discord: https://discord.gg/BxkW65z
Moderators IIYAMA Posted December 30, 2019 Moderators Posted December 30, 2019 That is not ging to work. The GTA engine will adjust the running speed to the default until the ped leaves the ground. You could try to use a walk animation and speed it up: https://wiki.multitheftauto.com/wiki/SetPedAnimationSpeed 1 Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
DiGiTal Posted December 30, 2019 Author Posted December 30, 2019 @IIYAMA nothing happens addEventHandler( "onClientResourceStart", getRootElement( ), function ( ) setPedAnimationSpeed (localPlayer,"sprint_civi",0.001) end ) Our Website : https://tutoplayfun.ml/ Our Discord: https://discord.gg/BxkW65z
Moderators Patrick Posted December 30, 2019 Moderators Posted December 30, 2019 It speeds up everything, but maybe helps: https://wiki.multitheftauto.com/wiki/SetGameSpeed community profile | map converters | map images | pDownloader | pAttach | model encrypter
Moderators IIYAMA Posted December 30, 2019 Moderators Posted December 30, 2019 (edited) 36 minutes ago, DiGiTal said: nothing happens Use resourceRoot, not getRootElement... or don't even use onResourceStart at all. Just run the line for the animation speed. Because wrong using this event can lead to bugs. Where are you starting the animation? Because it is missing in your code. Without animation you will not notice the difference. --------- P.s you might need this instead because it doesn't allow you to go faster than 100% = 1. https://wiki.multitheftauto.com/wiki/SetPedAnimationProgress Edited December 30, 2019 by IIYAMA Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
DiGiTal Posted December 30, 2019 Author Posted December 30, 2019 addEventHandler( "onClientRender", root, function ( ) setPedAnimationSpeed (localPlayer,"run_player",0.5) setPedAnimationSpeed (localPlayer,"SPRINT_civi",0.5) end ) @IIYAMA i used this works fine , but it slows the player. and the limit of the animspeed is 1 (1== default) https://wiki.multitheftauto.com/wiki/SetPedAnimationProgress tried doesn't work at all addEventHandler( "onClientRender", root, function ( ) setPedAnimationSpeed (localPlayer,"run_player",1) setPedAnimationSpeed (localPlayer,"SPRINT_civi",1) setPedAnimationProgress ( localPlayer "run_player",1) setPedAnimationProgress ( localPlayer "SPRINT_civi",1) end ) Our Website : https://tutoplayfun.ml/ Our Discord: https://discord.gg/BxkW65z
Moderators IIYAMA Posted December 30, 2019 Moderators Posted December 30, 2019 4 minutes ago, DiGiTal said: player. and the limit of the animspeed Use this instead: https://wiki.multitheftauto.com/wiki/SetPedAnimationProgress + onClientRender Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
DiGiTal Posted December 30, 2019 Author Posted December 30, 2019 animationProgress just my player no animation but like freezing but keep moving slowly Our Website : https://tutoplayfun.ml/ Our Discord: https://discord.gg/BxkW65z
Moderators IIYAMA Posted December 30, 2019 Moderators Posted December 30, 2019 3 minutes ago, DiGiTal said: animationProgress just my player no animation but like freezing but keep moving slowly An animation goes from 0 to 100%. That takes an amount of time. But what if you increase that progress? Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
DiGiTal Posted December 30, 2019 Author Posted December 30, 2019 addEventHandler( "onClientRender", root, function ( ) setPedAnimationProgress ( localPlayer,"run_player",1) setPedAnimationSpeed (localPlayer,"run_player",1) end ) like bugging animation but keep moving ,nothing more speed added Our Website : https://tutoplayfun.ml/ Our Discord: https://discord.gg/BxkW65z
Moderators IIYAMA Posted December 30, 2019 Moderators Posted December 30, 2019 38 minutes ago, DiGiTal said: like bugging animation but keep moving ,nothing more speed added You are putting the animation progress to 100% ever frame... That is the same as 0% progress. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
DiGiTal Posted December 30, 2019 Author Posted December 30, 2019 Why mention the progress of the animation , i think it's useless. i don't understand your idea Our Website : https://tutoplayfun.ml/ Our Discord: https://discord.gg/BxkW65z
Moderators IIYAMA Posted December 30, 2019 Moderators Posted December 30, 2019 4 minutes ago, DiGiTal said: Why mention the progress of the animation , i think it's useless. i don't understand your idea You do not understand that you have to go through an animation from 0% to 100% in order to even do the animation in the first place? Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
DiGiTal Posted December 30, 2019 Author Posted December 30, 2019 that's why i dont understand why we must specify a % for the animation ! ! so just need to speed it 1 Our Website : https://tutoplayfun.ml/ Our Discord: https://discord.gg/BxkW65z
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