Advertisement
Guest User

Untitled

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