Advertisement
Guest User

LUA script

a guest
Nov 22nd, 2017
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.31 KB | None | 0 0
  1. local Tool = script.Parent;
  2.  
  3. local walking = 0
  4. local hold
  5. local walk
  6. local walk2
  7. local walk3
  8. local walk4
  9. local walk5
  10.  
  11. odctrl = script.Parent.ODCTRL
  12.  
  13. enabled = true
  14. function onButton1Down(mouse)
  15.     if not enabled then
  16.         return
  17.     end
  18.  
  19. --blade:FireServer()
  20. end
  21.  
  22. function onKeyDown(key)
  23.     local vCharacter = Tool.Parent
  24.     local humanoid = vCharacter.Humanoid
  25.        
  26.     if walk and (key == "t") then
  27. if odctrl.Value == true then
  28.         walk:Play()
  29.         walking = walking + 1
  30.         print 't'
  31. end
  32. end
  33.    
  34.     if walk2 and (key == "q") then
  35. if odctrl.Value == true then
  36.         walk2:Play()
  37.         walking = walking + 1
  38.                 print 'q'
  39. end
  40. end
  41.    
  42.     if walk3 and (key == "e") then
  43. if odctrl.Value == true then
  44.         walk3:Play()
  45.         walking = walking + 1
  46.                 print 'e'
  47. end
  48. end
  49.    
  50.         if walk4 and (key == "r") then
  51.         if odctrl.Value == true then
  52.         walk4:Play()
  53.         walking = walking + 1
  54.             print 'r'
  55.         end
  56.         end
  57.    
  58.     if walk5 and (key == "f") then
  59. if odctrl.Value == true then
  60.         walk5:Play()
  61.         walking = walking + 1
  62.             print 'f'
  63.     end
  64.     end
  65.     end
  66.  
  67. function onKeyUp(key)
  68.     if walk or walk2 or walk3 or walk4 or walk5 and (key == "q") or (key == "e") or (key == "r") or (key == "f") or (key == "t") then
  69.         walking = walking - 1
  70.         if walking == 0 then
  71.             walk:Stop(0)
  72.             walk2:Stop(0)
  73.             walk3:Stop(0)
  74.             walk4:Stop(0)
  75.             walk5:Stop(0)
  76.         end
  77.     end
  78. end
  79.  
  80. function onEquippedLocal(mouse)
  81.  
  82.     if mouse == nil then
  83.         print("Mouse not found")
  84.         return
  85.     end
  86.  
  87.     local vCharacter = Tool.Parent
  88.     local humanoid = vCharacter.Humanoid
  89.  
  90.     hold = humanoid:LoadAnimation(Tool.RestingStance)
  91.     walk = humanoid:LoadAnimation(Tool.ForehandStance)
  92.     walk2 = humanoid:LoadAnimation(Tool.ForehandStance1)
  93.     walk3 = humanoid:LoadAnimation(Tool.ForehandStance2)
  94.     walk4 = humanoid:LoadAnimation(Tool.ForehandStance3)
  95.     walk5 = humanoid:LoadAnimation(Tool.RestingStance)
  96.  
  97.     hold:Play()
  98.  
  99.     --mouse.Icon = "rbxasset://textures\\GunCursor.png"
  100.     mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  101.     mouse.KeyDown:connect(onKeyDown)
  102.     mouse.KeyUp:connect(onKeyUp)
  103. end
  104.  
  105. function onUnequippedLocal()
  106.     hold:Stop()
  107.     walk:Stop()
  108.     walk2:Stop()
  109.     walk3:Stop()
  110.     walk4:Stop()
  111.     walk5:Stop()
  112.  
  113.     hold = nil
  114.     walk = nil
  115.     walk2 = nil
  116.     walk3 = nil
  117.     walk4 = nil
  118.     walk5 = nil
  119. end
  120.  
  121. Tool.Equipped:connect(onEquippedLocal)
  122. Tool.Unequipped:connect(onUnequippedLocal)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement