Advertisement
Guest User

Untitled

a guest
Dec 20th, 2021
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.69 KB | None | 0 0
  1. local function sprint()
  2.     --Cant sprint while aiming or jumping
  3.     let unallowedActions = {Whatever.Aim.Is, Enum.Keycode.Space}
  4.     --Filter unallowed actions
  5.     for i, v in pairs(unallowedActions) do:
  6.         if hotkeysStateTable[v] then return end
  7.     end
  8.     hotkeysStateTable[Enum.Keycode.Shift] = True
  9.     hotkeysFunctionTable[Enum.Keycode.Shift]()
  10. end
  11.  
  12. hotkeysFunctionTable = {[Enum.Keycode.Shift] = sprint, [Whatever.Aim.Is] = aimThing}
  13. hotkeysStateTable = {[Enum.Keycode.Shift] = false, [Whatever.Aim.Is] = false}
  14.  
  15. UIS.InputBegan:Connect(function(key, isTyping)
  16.     if isTyping then return end
  17.     --If we have a binding for the key
  18.     if hotkeysFunctionTable[key] then
  19.         hotkeysFunctionTable[key]()
  20.     end
  21. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement