alexop1000

events

Oct 1st, 2018
479
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.59 KB | None | 0 0
  1. local UserInputService  = game:GetService("UserInputService")
  2. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  3. local RunService        = game:GetService("RunService")
  4. local Workspace         = game:GetService("Workspace")
  5. local Players           = game:GetService("Players")
  6. local debounce          = true
  7. -- constants
  8. local PLAYER        = Players.LocalPlayer
  9. local CAMERA        = Workspace.CurrentCamera
  10. local EVENTS        = ReplicatedStorage:WaitForChild("Events")
  11. local IGNORE        = Workspace:WaitForChild("Ignore")
  12. local CHARACTERS    = Workspace:WaitForChild("Characters")
  13. local CHARACTER     = CHARACTERS:WaitForChild(PLAYER.Name)
  14. local FORCE         = CHARACTER:WaitForChild("VectorForce")
  15.  
  16. UserInputService.InputBegan:connect(function(inputObject, processed)
  17.     if not processed then
  18.         if inputObject.KeyCode == Enum.KeyCode.E then
  19.             if debounce == true then
  20.             EVENTS.Trick:Fire(CHARACTER, "Spin")
  21.             debounce = false
  22.             EVENTS.XP:FireServer()
  23.             wait(1)
  24.             debounce = true
  25.             end
  26.         elseif inputObject.KeyCode == Enum.KeyCode.Q then
  27.             if debounce == true then
  28.             EVENTS.Trick:Fire(CHARACTER, "Fly")
  29.             debounce = false
  30.             EVENTS.XP:FireServer()
  31.             wait(3)
  32.             debounce = true
  33.             end
  34.         elseif inputObject.KeyCode == Enum.KeyCode.R then
  35.             if debounce == true then
  36.             EVENTS.Trick:Fire(CHARACTER, "Wheelie")
  37.             debounce = false
  38.             EVENTS.XP:FireServer()
  39.             wait(2)
  40.             debounce = true
  41.             end
  42.         elseif inputObject.KeyCode == Enum.KeyCode.K then
  43.             if debounce == true then
  44.             EVENTS.Trick:Fire(CHARACTER, "Spin2")
  45.             debounce = false
  46.             EVENTS.XP:FireServer()
  47.             wait(1)
  48.             debounce = true
  49.             end
  50.         end
  51.     end
  52.             end)
Advertisement
Add Comment
Please, Sign In to add comment