Guest User

Untitled

a guest
Feb 7th, 2019
693
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. local crouched = false
  2.  
  3. Citizen.CreateThread( function()
  4. while true do
  5. Citizen.Wait( 1 )
  6.  
  7. local ped = GetPlayerPed( -1 )
  8.  
  9. if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then
  10. DisableControlAction( 0, 36, true ) -- INPUT_DUCK
  11.  
  12. if ( not IsPauseMenuActive() ) then
  13. if ( IsDisabledControlJustPressed( 0, 36 ) ) then
  14. RequestAnimSet( "move_ped_crouched" )
  15.  
  16. while ( not HasAnimSetLoaded( "move_ped_crouched" ) ) do
  17. Citizen.Wait( 100 )
  18. end
  19.  
  20. if ( crouched == true ) then
  21. ResetPedMovementClipset( ped, 0 )
  22. crouched = false
  23. elseif ( crouched == false ) then
  24. SetPedMovementClipset( ped, "move_ped_crouched", 0.25 )
  25. crouched = true
  26. end
  27. end
  28. end
  29. end
  30. end
  31. end )
Add Comment
Please, Sign In to add comment