SHARE
TWEET

Untitled

a guest Jun 17th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local Keys = {
  2.   ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57,
  3.   ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177,
  4.   ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18,
  5.   ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182,
  6.   ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81,
  7.   ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70,
  8.   ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178,
  9.   ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173,
  10.   ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118
  11. }
  12.  
  13. local crouched = false
  14. Citizen.CreateThread(function()
  15.     while true do
  16.         Citizen.Wait(1)
  17.  
  18.         local ped = GetPlayerPed(-1)
  19.  
  20.         if (DoesEntityExist(ped) and not IsEntityDead(ped)) and IsPedOnFoot(GetPlayerPed(-1)) then
  21.             DisableControlAction(0, 36, true) -- INPUT_DUCK  
  22.  
  23.             if (not IsPauseMenuActive()) then
  24.                 if (IsDisabledControlJustPressed(0, 36)) then
  25.                     RequestAnimSet("move_ped_crouched")
  26.  
  27.                     while (not HasAnimSetLoaded("move_ped_crouched")) do
  28.                         Citizen.Wait(1)
  29.                     end
  30.  
  31.                     if (crouched == true) then
  32.                         ResetPedMovementClipset(ped, 0)
  33.                         crouched = false
  34.                     elseif (crouched == false) then
  35.                         SetPedMovementClipset(ped, "move_ped_crouched", 0.25)
  36.                         crouched = true
  37.                     end
  38.                 end
  39.             end
  40.         end
  41.     end
  42. end)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top