Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tool = script.Parent
- local player = script.Parent.Parent.Parent
- local Character = player.Character or player.CharacterAdded:Wait()
- local RegionModule = require(game.ReplicatedStorage.RegionModule)
- local humanoid = Character:WaitForChild("Humanoid")
- repeat wait() until humanoid
- local repstorage = game:GetService("ReplicatedStorage")
- local debris = game:GetService("Debris")
- local combo = 0
- local cd = false
- local lasthit = 0
- local Damage = 2
- local BodyToughness = 0
- local touchedpart = false
- local alreadytouchedpart = false
- local ReplicatedStorage = game.ReplicatedStorage
- local Shake = ReplicatedStorage.Effects.ShakeScript
- local Rush = ReplicatedStorage.Gui.RushEffect
- local function findFirstCharacterInRegion(partsList)
- for _, part in next, partsList do
- if part.Parent and part.Parent:FindFirstChild"Humanoid" then
- return part.Parent
- end
- end
- end
- local function touched(hit)
- end
- function Explode()
- end
- tool.Activated:Connect(function()
- local velocity = Character.HumanoidRootPart.Velocity
- local unit = velocity.magnitude > 0 and velocity.unit or Vector3.new(0, 0, 0)
- local dot = unit:Dot(Character.HumanoidRootPart.CFrame.lookVector)
- local dot2 = Character.HumanoidRootPart.CFrame.rightVector:Dot(unit)
- local cf = Character.HumanoidRootPart.CFrame * CFrame.new(0, 1, -2.5)
- if math.abs(dot) > 0 then
- if math.floor(dot + 0.5) == 1 then
- cf = cf + Character.HumanoidRootPart.CFrame.lookVector * 4.5
- elseif math.floor(dot + 0.5) == -1 then
- cf = cf + Character.HumanoidRootPart.CFrame.lookVector * -3
- end
- end
- if math.abs(dot2) > 0 then
- if math.floor(dot2 + 0.5) == 1 then
- cf = cf + Character.HumanoidRootPart.CFrame.rightVector * 4.5
- elseif math.floor(dot2 + 0.5) == -1 then
- cf = cf + Character.HumanoidRootPart.CFrame.rightVector * -3
- end
- end
- local region = RegionModule.new(cf, Vector3.new(5.5, 5, 5.5))
- hitCharacter = findFirstCharacterInRegion(region:Cast(Character))
- if cd == true then return end
- cd = true
- if tick() - lasthit < .3 then
- combo = combo + 1
- print(combo)
- else
- combo = 1
- end
- lasthit = tick() + .8
- local animsplay = humanoid:LoadAnimation(tool["Punch"..(combo)])
- animsplay:Play()
- if hitCharacter then
- local hitPlayer = game.Players:GetPlayerFromCharacter(hitCharacter)
- local Effects = repstorage.Effects["Combat"].testing12:Clone()
- hitCharacter:FindFirstChild("Humanoid"):TakeDamage(Damage - BodyToughness)
- if hitPlayer then
- local Swag = Effects
- debris:AddItem(Swag, 2)
- Swag.Parent = hitCharacter.UpperTorso
- Swag.CFrame = hitCharacter:FindFirstChild("UpperTorso").CFrame
- Swag.Anchored = true
- local Huh = Shake:Clone()
- debris:AddItem(Huh, 2)
- Huh.Parent = hitCharacter
- Huh.Disabled = false
- local Huh2 = Rush:Clone()
- debris:AddItem(Huh2, 2)
- Huh2.Parent = hitPlayer.PlayerGui
- Huh2.Image.LocalScript.Disabled = false
- end
- end
- if hitCharacter and combo == 5 then
- local knockedback = Instance.new("Folder")
- debris:AddItem(knockedback, 2)
- knockedback.Parent = hitCharacter.Humanoid
- knockedback.Name = "Knockedback"
- local bvenemy = Instance.new("BodyVelocity")
- bvenemy.MaxForce = Vector3.new(1e7, 1e7, 1e7)
- bvenemy.Velocity = Character.HumanoidRootPart.CFrame.lookVector * 45 + Vector3.new(0,12,0)
- debris:AddItem(bvenemy, .65)
- bvenemy.Parent = hitCharacter.HumanoidRootPart
- local stun = hitCharacter.Humanoid:LoadAnimation(tool["Stun"..math.random(1,2)])
- stun:Play()
- end
- if combo == 5 then
- combo = 1
- alreadytouchedpart = false
- if hitCharacter and hitCharacter.Humanoid.Knockedback then
- hitCharacter.Humanoid.Touched:Connect(function(hitPart)
- if touchedpart == true then return end
- if alreadytouchedpart == true then return end
- if hitPart.CanCollide == false then return end
- if hitPart then
- wait(.2)
- if hitCharacter == nil then return end
- touchedpart = true
- local BOOM = ReplicatedStorage.Items.Explosion:Clone()
- debris:AddItem(BOOM, 5)
- BOOM.Parent = workspace
- BOOM.CFrame = hitCharacter.HumanoidRootPart.CFrame
- BOOM.Script.Disabled = false
- local TrailColors = {hitPart.Color}
- local function Trails()
- local TrailPart = Instance.new("Part")
- local bv = Instance.new("BodyVelocity", TrailPart)
- bv.MaxForce = Vector3.new(1e8,1e5, 1e8)
- bv.Velocity = Vector3.new(math.random(-80,80),math.random(20,60),math.random(-80,80))
- debris:AddItem(bv, .45)
- TrailPart.Name = "TrailPart"
- TrailPart.Material = "Slate"
- TrailPart.Color = Color3.new(hitPart.Color)
- TrailPart.Transparency = 0
- TrailPart.Anchored = false
- TrailPart.CanCollide = false
- TrailPart.FormFactor = "Custom"
- TrailPart.Size = Vector3.new(3.5,3.5,3.5)
- TrailPart.Parent = game.Workspace
- TrailPart.CFrame = hitCharacter.HumanoidRootPart.CFrame
- end
- Trails()
- Trails()
- Trails()
- Trails()
- Trails()
- Trails()
- Trails()
- Trails()
- Trails()
- Trails()
- alreadytouchedpart = true
- touchedpart = false
- else
- print"nochars"
- end
- end)
- end
- end
- if combo == 4 then
- wait(.3)
- end
- wait(.38)
- cd = false
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement