Fifkee

Keystroke Template

Apr 27th, 2018
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.93 KB | None | 0 0
  1. --[[
  2. ---------------------:HOW TO USE:---------------------
  3. Edit the amount of keystrokes you have. (At keystrokelist)
  4. Now, add a function with the exact same name as that keystroke.
  5. If you don't want the function to run unless a certain variable is true, then write like this:
  6.     if not something then
  7.         return false
  8.     end
  9.  
  10. If you do return nil, it'll still work.
  11. That's all.
  12. --]]
  13. ScreenGui1 = Instance.new("ScreenGui", game.Players.LocalPlayer:WaitForChild('PlayerGui'))
  14. Frame2 = Instance.new("Frame", ScreenGui1)
  15. textGui = Instance.new("TextLabel", Frame2)
  16. Frame2.Transparency = 0
  17. Frame2.Size = UDim2.new(0.538, 0,0.137, 0)
  18. Frame2.Position = UDim2.new(0.213584289, 0, 0, 0)
  19. Frame2.BackgroundColor3 = Color3.new(1, 1, 1)
  20. Frame2.BackgroundTransparency = 1
  21. textGui.Transparency = 0
  22. textGui.Size = UDim2.new(1, 0, 1, 0)
  23. textGui.Text = ""
  24. textGui.BackgroundColor3 = Color3.new(1, 1, 1)
  25. textGui.BackgroundTransparency = 1
  26. textGui.Font = Enum.Font.Fantasy
  27. textGui.FontSize = Enum.FontSize.Size96
  28. textGui.TextColor3 = Color3.new(1, 0.0941177, 0.305882)
  29. textGui.TextWrapped = true
  30. textGui.TextXAlignment = Enum.TextXAlignment.Left
  31.  
  32. keystrokes = {}
  33. keystrokeFunctions = {}
  34. --[[THINGS YOU CAN MODIFY]]--
  35. resetKey = "\\"
  36. keystrokelist = {
  37.     ['adadadq'] = true,
  38.     ['wasd'] = true
  39. }
  40. do --functions here
  41.     keystrokeFunctions.adadadq = function()
  42.         if game.Players.LocalPlayer.Character.Humanoid.FloorMaterial ~= Enum.Material.Air then
  43.             game.Players.LocalPlayer.Character:FindFirstChild('Humanoid', true).JumpPower = 100
  44.             game.Players.LocalPlayer.Character.Humanoid.Jump = true
  45.             wait(0.1)
  46.             game.Players.LocalPlayer.Character:FindFirstChild('Humanoid', true).JumpPower = 50
  47.         else
  48.             return false
  49.         end
  50.     end
  51.     keystrokeFunctions.wasd = function()
  52.         if game.Players.LocalPlayer.Character.Humanoid.FloorMaterial ~= Enum.Material.Air then
  53.             return false
  54.         else
  55.             local bv = Instance.new("BodyVelocity", game.Players.LocalPlayer.Character)
  56.             bv.Velocity = Vector3.new(0, -25000, 0)
  57.            
  58.             repeat wait()
  59.             until game.Players.LocalPlayer.Character.Humanoid.FloorMaterial ~= Enum.Material.Air
  60.             bv:Destroy()
  61.             return true
  62.         end
  63.     end
  64. end
  65. --[[BELOW: UNTOUCHABLES]]--
  66. spawn(function(s)
  67.     while true do
  68.         wait()
  69.         textGui.Text = table.concat(keystrokes, '')
  70.     end
  71. end)
  72. mouse = game:GetService('Players').LocalPlayer:GetMouse()
  73. mouse.KeyDown:connect(function(key)
  74.     if key == "0" then return nil end
  75.     if key == resetKey or key == '' or key == ' ' then
  76.         print('Resetted keystrokes.')
  77.         keystrokes = {}
  78.         return nil
  79.     end
  80.     if #keystrokes >= 14 then
  81.         print('over 14')
  82.         local gui = textGui:Clone()
  83.         gui.Text = gui.Text..key
  84.         gui.Parent = (Frame2) --14 characters
  85.         gui:TweenPosition(UDim2.new(0,0,1.3,0), "Out", "Quad", 5)
  86.         gui.TextColor3 = Color3.fromRGB(0,0,0)
  87.         spawn(function(s)
  88.             for i = 0, 1, 0.1 do
  89.                 wait()
  90.                 gui.TextTransparency = i
  91.             end
  92.         end)
  93.         keystrokes = {}
  94.         wait(1)
  95.         gui:Destroy()
  96.         return nil
  97.     end
  98.     table.insert(keystrokes, key)
  99.     print(table.concat(keystrokes, ''))
  100.     if keystrokelist[table.concat(keystrokes, '')] then
  101.         print('yay')
  102.         local asd = keystrokeFunctions[table.concat(keystrokes, '')]()
  103.         if asd == false then
  104.             local gui = textGui:Clone()
  105.             gui.Text = gui.Text..key
  106.             gui.Parent = (Frame2) --14 characters
  107.             gui:TweenPosition(UDim2.new(0,0,1.3,0), "Out", "Quad", 5)
  108.             gui.TextColor3 = Color3.fromRGB(0,0,0)
  109.             spawn(function(s)
  110.                 for i = 0, 1, 0.1 do
  111.                     wait()
  112.                     gui.TextTransparency = i
  113.                 end
  114.             end)
  115.             spawn(function(asd)
  116.                 wait(1)
  117.                 gui:Destroy()
  118.             end)
  119.             keystrokes = {}
  120.             return nil
  121.         end
  122.         local gui = textGui:Clone()
  123.         gui.Text = gui.Text..key
  124.         gui.Parent = (Frame2) --14 characters
  125.         gui:TweenPosition(UDim2.new(0,0,1.3,0), "Out", "Quad", 5)
  126.         gui.TextColor3 = Color3.fromRGB(0,255,0)
  127.         spawn(function(s)
  128.             for i = 0, 1, 0.1 do
  129.                 wait()
  130.                 gui.TextTransparency = i
  131.             end
  132.         end)
  133.         keystrokes = {}
  134.         wait(1)
  135.         gui:Destroy()
  136.     end
  137. end)
Advertisement
Add Comment
Please, Sign In to add comment