Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tool = script.Parent
- local player = game:GetService("Players").LocalPlayer
- local uis = game:GetService("UserInputService")
- local remote = game.ReplicatedStorage.Remotes:WaitForChild("CombatRemote")
- local pgui = game:GetService("Players").LocalPlayer.PlayerGui
- local humanoid = player.Character.Humanoid
- local char = player.Character
- local debounce = false
- local blackFlash = false
- local combo = char:WaitForChild("Combo")
- local uis = game:GetService("UserInputService")
- tool.Equipped:Connect(function()
- if char:WaitForChild("Stunned").Value == true then return end
- if char:WaitForChild("Blocking").Value == true then return end
- local animation = game.ReplicatedStorage.Animations.Combat.CrackKnuckles
- local track = humanoid:LoadAnimation(animation)
- track:Play()
- local animation2 = game.ReplicatedStorage.Animations.Combat.CombatStance
- local track2 = humanoid:LoadAnimation(animation2)
- track2:Play()
- end)
- tool.Unequipped:Connect(function()
- local animator = humanoid:FindFirstChildOfClass("Animator")
- for i,v in ipairs(animator:GetPlayingAnimationTracks()) do
- if v.Name == "CombatStance" then
- v:Stop()
- end
- end
- end)
- tool.Activated:Connect(function()
- if debounce then return end
- if char:WaitForChild("Attacking").Value == true then return end
- if char:WaitForChild("Stunned").Value == true then return end
- if char:WaitForChild("Blocking").Value == true then return end
- combo.Value += 1
- debounce = true
- local bfChance = math.random(1, 40)
- if bfChance == 1 then
- blackFlash = true
- player.PlayerGui:WaitForChild("EssentialGUI").BlackFlash.Visible = true
- combo.Value = 0
- end
- if combo.Value < 4 then
- if blackFlash == true then
- remote:FireServer("BlackFlash")
- blackFlash = false
- else
- remote:FireServer("Normal")
- end
- elseif combo.Value >= 4 then
- if blackFlash == true then
- remote:FireServer("BlackFlash")
- blackFlash = false
- else
- remote:FireServer("Final")
- end
- else
- warn("what did bro do")
- end
- print("M1!")
- local swing = game:GetService("SoundService").Swing:Clone()
- swing.Parent = char
- swing:Play()
- game.Debris:AddItem(swing, 0.15)
- local m1Anim = math.random(1, 2)
- local anim = game.ReplicatedStorage.Animations.Combat["Punch " .. combo.Value]
- local track = humanoid:LoadAnimation(anim)
- humanoid.WalkSpeed = 8
- track:Play()
- wait(0.5)
- humanoid.WalkSpeed = 16
- if combo.Value >= 4 then
- combo.Value = 0
- wait(2)
- end
- debounce = false
- player.PlayerGui:WaitForChild("EssentialGUI").BlackFlash.Visible = false
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement