Advertisement
Guest User

Deadeye LUA script (w/ vehicle fix)

a guest
Oct 2nd, 2016
659
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Controls:
  2. -- Press LT and Dpad Down to toggle mod on
  3. -- Aim (LT) to reduce speed to 25%
  4.  
  5. local SloMo = {}
  6.  
  7. local mod = false
  8. local mod_toggle = false
  9.  
  10. function SloMo.unload()
  11. end
  12.  
  13. function SloMo.init()
  14. end
  15.  
  16. function SloMo.tick()
  17.     local playerPed = PLAYER.PLAYER_PED_ID()
  18.     local player = PLAYER.GET_PLAYER_PED(playerPed)
  19.     local playerExists = ENTITY.DOES_ENTITY_EXIST(playerPed)
  20.     if not playerExists then
  21.         return
  22.     end
  23.    
  24.     if(CONTROLS.IS_CONTROL_PRESSED(2,10)) and (CONTROLS.IS_CONTROL_JUST_PRESSED(2,19))then
  25.         mod_toggle = true
  26.     elseif mod_toggle then
  27.         mod_toggle=false
  28.                 if(mod)then
  29.                     mod=false
  30.                     GAMEPLAY.SET_TIME_SCALE(1)
  31.                    
  32.                     UI._SET_NOTIFICATION_TEXT_ENTRY("STRING");
  33.                     UI._ADD_TEXT_COMPONENT_STRING("Deadeye ~r~Off~r~");
  34.                     UI._DRAW_NOTIFICATION(false, false);
  35.                     print("mod = false")
  36.                 else
  37.                     mod=true
  38.                     UI._SET_NOTIFICATION_TEXT_ENTRY("STRING");
  39.                     UI._ADD_TEXT_COMPONENT_STRING("Deadeye ~g~On~g~");
  40.                     UI._DRAW_NOTIFICATION(false, false);
  41.                     print("mod = true")
  42.                 end
  43.     end
  44.    
  45.     if(mod)then
  46.         --[[UI.SET_TEXT_FONT(0)
  47.         UI.SET_TEXT_SCALE(0.1, 0.25)
  48.         UI.SET_TEXT_COLOUR(255, 255, 255, 255)
  49.         UI.SET_TEXT_CENTRE(true)
  50.         UI.SET_TEXT_DROPSHADOW(0, 0, 0, 0, 0)
  51.         UI.SET_TEXT_EDGE(0, 0, 0, 0, 0)
  52.         UI._SET_TEXT_ENTRY("STRING")
  53.         UI._ADD_TEXT_COMPONENT_STRING("SloMo")
  54.         UI._DRAW_TEXT(0.05,0.02)]]
  55.        
  56.         if PLAYER.IS_PLAYER_FREE_AIMING(player) then
  57.             if CONTROLS.GET_CONTROL_NORMAL(2, 10) >= 0.9 then --this is at least 90% pressed, change it to your liking.
  58.             GAMEPLAY.SET_TIME_SCALE(.25) --this is 25% speed, change this number to your liking.
  59.             else
  60.             GAMEPLAY.SET_TIME_SCALE(1)
  61.             end
  62.         end
  63.     end
  64. end
  65.  
  66. return SloMo
Advertisement
RAW Paste Data Copied
Advertisement