Advertisement
Ultimate_69

Untitled

Mar 24th, 2024
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.60 KB | None | 0 0
  1. local tool = script.Parent
  2. local player = game:GetService("Players").LocalPlayer
  3. local uis = game:GetService("UserInputService")
  4. local remote = game.ReplicatedStorage.Remotes:WaitForChild("CombatRemote")
  5. local pgui = game:GetService("Players").LocalPlayer.PlayerGui
  6. local humanoid = player.Character.Humanoid
  7. local char = player.Character
  8. local debounce = false
  9. local blackFlash = false
  10. local combo = char:WaitForChild("Combo")
  11. local uis = game:GetService("UserInputService")
  12.  
  13.  
  14.  
  15. tool.Equipped:Connect(function()
  16.     if char:WaitForChild("Stunned").Value == true then return end
  17.     if char:WaitForChild("Blocking").Value == true then return end
  18.     local animation = game.ReplicatedStorage.Animations.Combat.CrackKnuckles
  19.     local track = humanoid:LoadAnimation(animation)
  20.     track:Play()
  21.     local animation2 = game.ReplicatedStorage.Animations.Combat.CombatStance
  22.     local track2 = humanoid:LoadAnimation(animation2)
  23.     track2:Play()
  24. end)
  25.  
  26. tool.Unequipped:Connect(function()
  27.     local animator = humanoid:FindFirstChildOfClass("Animator")
  28.     for i,v in ipairs(animator:GetPlayingAnimationTracks()) do
  29.         if v.Name == "CombatStance" then
  30.             v:Stop()
  31.         end
  32.     end
  33. end)
  34.  
  35. tool.Activated:Connect(function()
  36.         if debounce then return end
  37.         if char:WaitForChild("Attacking").Value == true then return end
  38.         if char:WaitForChild("Stunned").Value == true then return end
  39.         if char:WaitForChild("Blocking").Value == true then return end
  40.         combo.Value += 1
  41.         debounce = true
  42.         local bfChance = math.random(1, 40)
  43.         if bfChance == 1 then
  44.             blackFlash = true
  45.             player.PlayerGui:WaitForChild("EssentialGUI").BlackFlash.Visible = true
  46.             combo.Value = 0
  47.         end
  48.        
  49.         if combo.Value < 4 then
  50.             if blackFlash == true then
  51.                 remote:FireServer("BlackFlash")
  52.                 blackFlash = false
  53.             else
  54.                 remote:FireServer("Normal")
  55.             end
  56.         elseif combo.Value >= 4 then
  57.             if blackFlash == true then
  58.                 remote:FireServer("BlackFlash")
  59.                 blackFlash = false
  60.             else
  61.             remote:FireServer("Final")
  62.             end
  63.         else
  64.             warn("what did bro do")
  65.         end
  66.        
  67.         print("M1!")
  68.         local swing = game:GetService("SoundService").Swing:Clone()
  69.         swing.Parent = char
  70.         swing:Play()
  71.         game.Debris:AddItem(swing, 0.15)
  72.        
  73.         local m1Anim = math.random(1, 2)
  74.        
  75.         local anim = game.ReplicatedStorage.Animations.Combat["Punch " .. combo.Value]
  76.         local track = humanoid:LoadAnimation(anim)
  77.         humanoid.WalkSpeed = 8
  78.         track:Play()
  79.    
  80.        
  81.         wait(0.5)
  82.        
  83.         humanoid.WalkSpeed = 16
  84.        
  85.         if combo.Value >= 4 then
  86.             combo.Value = 0
  87.             wait(2)
  88.         end
  89.        
  90.         debounce = false
  91.         player.PlayerGui:WaitForChild("EssentialGUI").BlackFlash.Visible = false
  92.    
  93. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement