Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. local ui_get, entity_get_local_player, entity_get_prop, bit_band, globals_realtime = ui.get, entity.get_local_player, entity.get_prop, bit.band, globals.realtime
  2. local FL_ONGROUND = 1
  3. local onground_prev = true
  4.  
  5. local DURATION = 0.1
  6. local duck_until
  7. local edge_jump_enabled_reference, edge_jump_hotkey_reference = ui.reference("MISC", "Miscellaneous", "Jump at edge")
  8.  
  9. client.set_event_callback("setup_command", function(cmd)
  10. if ui_get(edge_jump_enabled_reference) and ui_get(edge_jump_hotkey_reference) then
  11. local onground = bit_band(entity_get_prop(entity_get_local_player(), "m_fFlags"), FL_ONGROUND) == FL_ONGROUND
  12. if cmd.in_duck == 0 then
  13. if onground_prev and not onground then
  14. duck_until = globals_realtime()+DURATION
  15. end
  16. if duck_until ~= nil and duck_until > globals_realtime() then
  17. cmd.in_duck = 1
  18. end
  19. end
  20. onground_prev = onground
  21. end
  22. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement