Advertisement
killerbrenden

2000+ Characters lol

Jul 3rd, 2020
2,884
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.83 KB | None | 0 0
  1. local Combo = 0
  2. local TimeToAttack = .8 -- time in between attacks before it resets to 0
  3. local Damage = 6 -- damage done to the player
  4. local Range = 7 -- Range around you
  5. local replicatedStorage = game:GetService("ReplicatedStorage")
  6. local CMB = true
  7.  
  8. script.Parent.OnServerEvent:Connect(function(Player, EnemBlocking)
  9.  
  10. local Character = Player.Character
  11. local Humanoid = Character.Humanoid
  12.  
  13. Combo = Combo + 1
  14.  
  15. local leftPunch = Humanoid:LoadAnimation(script.leftPunch)
  16. local rightPunch = Humanoid:LoadAnimation(script.rightPunch)
  17. local leftUpperCut = Humanoid:LoadAnimation(script.leftUpperCut)
  18. local rightUpperCut = Humanoid:LoadAnimation(script.rightUpperCut)
  19.  
  20. for i,v in pairs(game.Workspace:GetChildren()) do
  21.     local m = (v:IsA("Model") and v) or nil
  22.         if m and m:FindFirstChild("Humanoid") and m:FindFirstChild("HumanoidRootPart") and m ~= Character then
  23.             if (Character.HumanoidRootPart.Position - m.HumanoidRootPart.Position).magnitude <= Range then
  24.                
  25.                 if Combo == 1 or Combo == 2 or Combo == 3 or Combo == 4 or Combo == 5 then
  26.                     if CMB == false then return end
  27.                    
  28.                     local hiteffect = replicatedStorage:WaitForChild("HitEffect"):Clone()
  29.                     hiteffect.CanCollide = false
  30.                     hiteffect.Anchored = true
  31.                     hiteffect.CFrame = m.HumanoidRootPart.CFrame
  32.                     hiteffect.Parent = workspace
  33.                     game.Debris:AddItem(hiteffect,0.4)
  34.                     local hit = Instance.new("BoolValue",m)
  35.                     hit.Name = "Hit"
  36.                     game.Debris:AddItem(hit,0.7)
  37.                     m.Humanoid:TakeDamage(Damage)
  38.                         spawn(function()
  39.                         m.CMB = false
  40.                         m.Humanoid.WalkSpeed = 1
  41.                         m.Humanoid.JumpPower = 1
  42.                         wait(1)
  43.                         m.CMB = true
  44.                         m.Humanoid.WalkSpeed = 16
  45.                         m.Humanoid.JumpPower = 50
  46.                        
  47.                        
  48.                     end)
  49.                 end
  50.                
  51.                 if Combo == 1 then
  52.                     local Punched1 = script.Punched1:Clone()
  53.                     Punched1.Parent = m.Head
  54.                     Punched1:Play()
  55.                     game.Debris:AddItem(Punched1,.4)
  56.                     m.Humanoid:LoadAnimation(script.PunchedRight):Play()
  57.                 end
  58.                
  59.                 if Combo == 2 then
  60.                     local Punched2 = script.Punched2:Clone()
  61.                     Punched2.Parent = m.Head
  62.                     Punched2:Play()
  63.                     game.Debris:AddItem(Punched2,.4)
  64.                     m.Humanoid:LoadAnimation(script.PunchedLeft):Play()
  65.                 end
  66.                
  67.                 if Combo == 3 then
  68.                     local Punched3 = script.Punched3:Clone()
  69.                     Punched3.Parent = m.Head
  70.                     Punched3:Play()
  71.                     game.Debris:AddItem(Punched3,.4)
  72.                     m.Humanoid:LoadAnimation(script.rightUpperCutFace):Play()
  73.                 end
  74.                
  75.                 if Combo == 4 then
  76.                     local Punched4 = script.Punched4:Clone()
  77.                     Punched4.Parent = m.Head
  78.                     Punched4:Play()
  79.                     game.Debris:AddItem(Punched4,.3)
  80.                     m.Humanoid:LoadAnimation(script.leftUpperCutPunch):Play()
  81.                    
  82.                 end
  83.                
  84.                
  85.             end
  86.         end
  87.     end
  88.  
  89. if Combo == 1 then
  90. leftPunch:Play()
  91.  
  92. local Swing = script.SwingFist:Clone()
  93. Swing.Parent = Character.HumanoidRootPart
  94. Swing:Play()
  95.    
  96. else if Combo == 2 then
  97. rightPunch:Play()
  98.  
  99. local Swing = script.SwingFist:Clone()
  100. Swing.Parent = Character.HumanoidRootPart
  101. Swing:Play()
  102.  
  103. spawn(function()
  104.     wait(TimeToAttack)
  105.     if Combo == 2 then
  106.         Combo = 0
  107.     end
  108. end)
  109.  
  110. else if Combo == 3 then
  111. leftUpperCut:Play()
  112.  
  113. local Swing = script.SwingFist:Clone()
  114. Swing.Parent = Character.HumanoidRootPart
  115. Swing:Play()
  116.  
  117. spawn(function()
  118.     wait(TimeToAttack)
  119.     if Combo == 3 then
  120.         Combo = 0
  121.     end
  122. end)
  123.  
  124. else if Combo == 4 then
  125.                     rightUpperCut:Play()
  126.                    
  127. local Swing = script.SwingFist:Clone()
  128. Swing.Parent = Character.HumanoidRootPart
  129. Swing:Play()
  130.  
  131. spawn(function()
  132.     wait(TimeToAttack)
  133.     if Combo == 4 then
  134.         Combo = 0
  135.     end
  136. end)
  137.  
  138.  
  139. Combo = 100
  140. wait(2)
  141. Combo = 0
  142.                        
  143.             end
  144.         end
  145.     end
  146. end
  147.  
  148. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement