Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Tool = script.Parent
- local RS = game.ReplicatedStorage
- local RunService = game:GetService("RunService")
- local UniEvents = RS.UniversalEvents
- local Debris = game.Debris
- local CharacterFolder = RS.Characters
- local YujiFolder = CharacterFolder.Yuji
- local YujiEffects = YujiFolder.Effects
- local YujiEvents = YujiFolder.Events
- local YujiAnimations= YujiFolder.Animations
- local YujiSounds = YujiFolder.Sounds
- local YujiAccessories = YujiFolder.Accessories
- local TweenService = game:GetService("TweenService")
- --
- local MaxCombo = 4
- --Divergent Fist
- local DivergentFistOnCD = false
- local DivergentFistCDTime = 22
- local DivergentFistDuration = 10
- --Black Flash
- local BlackFlashOnCD = false
- local BlackFlashCDTime = 30
- --Transformation
- local TransformationPlaying = false
- local TransformationCDTime = 30
- local TransformationDuration = 15
- local TransformationOn = false
- local TransformationCD = false
- --Tool.Equipped:Connect(function()
- -- ToolOn = true
- -- local Character = Tool.Parent
- --end)
- --Tool.Unequipped:Connect(function()
- -- ToolOn = false
- -- FireLeft:Destroy()
- -- FireRight:Destroy()
- --end)
- local function UpdateCombo(Character)
- local CurrentCombo = Character:GetAttribute("Combo")
- if CurrentCombo >= MaxCombo then
- Character:SetAttribute("Combo", 1)
- else
- Character:SetAttribute("Combo", CurrentCombo + 1)
- end
- end
- local function StopAnimations(Humanoid, TrackName)
- if TrackName ~= nil then
- print("Stop ",TrackName)
- for _, track in pairs(Humanoid:GetPlayingAnimationTracks()) do
- if track == TrackName then
- track:Stop()
- return
- end
- end
- else
- print("Stop All")
- for _, track in pairs(Humanoid:GetPlayingAnimationTracks()) do
- track:Stop()
- end
- end
- end
- local function TweenTransparency(Part,duration)
- local duration = 2
- local tweenInfo = TweenInfo.new(duration, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
- local goal = {Transparency = 1}
- local tween = TweenService:Create(Part, tweenInfo, goal)
- tween:Play()
- tween.Completed:Connect(function()
- end)
- end
- local function VFXTweenRate(Particle,Duration)
- local tweenInfo = TweenInfo.new(Duration, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
- local properties = {Rate = 0}
- local tween = TweenService:Create(Particle, tweenInfo, properties)
- tween:Play()
- tween.Completed:Connect(function()
- task.wait(3)
- Particle:Destroy()
- end)
- end
- local function AddBV(HumanoidRootPart,Strength, Duration)
- local BodyVelocity = Instance.new("BodyVelocity")
- BodyVelocity.MaxForce = Vector3.new(1, 1, 1) * math.huge
- BodyVelocity.Velocity = HumanoidRootPart.CFrame.LookVector * Strength
- BodyVelocity.Parent = HumanoidRootPart
- game.Debris:AddItem(BodyVelocity, Duration)
- end
- UniEvents.Mouse1Attack.OnServerEvent:Connect(function(Player)
- local Character = Player.Character
- local Humanoid = Character:WaitForChild("Humanoid")
- local Animator = Humanoid:WaitForChild("Animator")
- local AttackAnimation = YujiAnimations.Combat[tostring(Character:GetAttribute("Combo"))]
- local AttackAnimationTrack = Animator:LoadAnimation(AttackAnimation)
- local IsAttacking = Character:GetAttribute("IsAttacking")
- local OrgWalkSpeed = Humanoid.WalkSpeed
- local AttackWalkSpeed = 6
- if IsAttacking then return end
- Humanoid.WalkSpeed = AttackWalkSpeed
- AttackAnimationTrack:Play()
- Character:SetAttribute("IsAttacking", true)
- AddBV(Character.HumanoidRootPart, 15, .5)
- AttackAnimationTrack.Stopped:Connect(function()
- print("Animation Done")
- UpdateCombo(Character)
- Character:SetAttribute("IsAttacking", false)
- Humanoid.WalkSpeed = OrgWalkSpeed
- end)
- repeat wait()
- print("wait")
- until not Character:GetAttribute("IsAttacking")
- end)
- YujiEvents.DivergentFist.OnServerEvent:Connect(function(Player)
- local Character = Player.Character
- local Humanoid = Character:WaitForChild("Humanoid")
- local Animator = Humanoid:WaitForChild("Animator")
- local DivergentFistAnimation = YujiAnimations.DivergentFistOnNew
- if TransformationOn then return end
- if not DivergentFistOnCD then
- DivergentFistOnCD = true
- local SkillAnimationTrack = Animator:LoadAnimation(DivergentFistAnimation)
- local FireSound = YujiSounds.fire:Clone()
- local VoiceSound = YujiSounds.GOJO:Clone()
- VoiceSound.Parent = Character
- VoiceSound:Play()
- Debris:AddItem(VoiceSound,3.8)
- UniEvents.DisableControls:FireClient(Player)
- SkillAnimationTrack:Play()
- SkillAnimationTrack.KeyframeReached:Connect(function(KF)
- if KF == "StartFire" then
- local FireLeft = YujiFolder.Effects.FireLeft:Clone()
- local FireRight = YujiFolder.Effects.FireRight:Clone()
- FireLeft.Parent = Character["Left Arm"].LeftGripAttachment
- FireRight.Parent = Character["Right Arm"].RightGripAttachment
- FireSound.Parent = Character
- FireSound:Play()
- Debris:AddItem(FireSound,5)
- repeat wait()
- until not SkillAnimationTrack.IsPlaying
- UniEvents.EnableControls:FireClient(Player)
- local Counter = DivergentFistDuration
- repeat wait(1)
- Counter -= 1
- until Counter <= 0
- print("Effect Over")
- FireLeft:Destroy()
- FireRight:Destroy()
- local Counter = DivergentFistCDTime
- repeat wait(1)
- Counter -= 1
- until Counter <= 0
- print("Cooldown Over")
- DivergentFistOnCD = false
- end
- end)
- end
- end)
- YujiEvents.BlackFlashStart.OnServerEvent:Connect(function(Player)
- local Character = Player.Character
- local Humanoid = Character:WaitForChild("Humanoid")
- local Animator = Humanoid:WaitForChild("Animator")
- local BlackFlashAnimation = YujiAnimations.BlackFlashStartPos
- local PoseSound = YujiSounds.BlackFlashStart:Clone()
- if Character:GetAttribute("BlackFlash") or TransformationOn then return end
- if not BlackFlashOnCD then
- Character:SetAttribute("BlackFlash", true)
- BlackFlashOnCD = true
- local SkillAnimationTrack = Animator:LoadAnimation(BlackFlashAnimation)
- PoseSound.Parent = Character.Head
- PoseSound:Play()
- Debris:AddItem(PoseSound,2.5)
- UniEvents.DisableControls:FireClient(Player)
- SkillAnimationTrack:Play()
- SkillAnimationTrack.KeyframeReached:Connect(function(KF)
- if KF == "Pause" then
- SkillAnimationTrack:AdjustSpeed(0)
- YujiEvents.BlackFlashPaused:FireClient(Player)
- end
- end)
- --SkillAnimationTrack.Stopped:Connect(function()
- -- warn("Animation was not paused")
- --end)
- end
- end)
- YujiEvents.BlackFlash.OnServerEvent:Connect(function(Player, CFramePos)
- local Character = Player.Character
- Character.Archivable = true
- local Humanoid = Character:WaitForChild("Humanoid")
- local Animator = Humanoid:WaitForChild("Animator")
- local PunchAnim = YujiAnimations.BlackFlashFinishPunch
- local SkillAnimationTrack = Animator:LoadAnimation(PunchAnim)
- StopAnimations(Humanoid)
- local Clone = Character:Clone()
- local CloneHumanoid = Clone:WaitForChild("Humanoid")
- local CloneAnimator = CloneHumanoid:WaitForChild("Animator")
- local PausedBlackFlashAnimation = YujiAnimations.BlackFlashPaused
- local BlackFlashSound = YujiSounds.BlackFlash:Clone()
- BlackFlashSound.Parent = Character.HumanoidRootPart
- for _, Part in pairs(Clone:GetChildren()) do
- if Part:IsA("BasePart") then
- Part.CollisionGroup = "Clone"
- end
- end
- Clone.Parent = workspace
- Clone.HumanoidRootPart.CFrame = Player.Character.HumanoidRootPart.CFrame
- local CloneSkillAnimationTrack = CloneAnimator:LoadAnimation(PausedBlackFlashAnimation)
- CloneSkillAnimationTrack:Play()
- SkillAnimationTrack:Play()
- BlackFlashSound:Play()
- SkillAnimationTrack.KeyframeReached:Connect(function(KF)
- if KF == "PunchEnd" then
- wait(1)
- for i,v in pairs(Clone:GetDescendants()) do
- if v:IsA("BasePart") or v:IsA("Part") then
- TweenTransparency(v,2)
- elseif v:IsA("Decal") then
- TweenTransparency(v,2)
- end
- end
- wait(4)
- Clone:Destroy()
- end
- end)
- local BlackLightning = YujiEffects.BlackLightning:Clone()
- local BlackLightHand = YujiEffects.BlackLightningHand:Clone()
- local RedLightning = YujiEffects.RedLightning:Clone()
- local RedLightHand = YujiEffects.RedLightningHand:Clone()
- BlackLightHand.Parent = Character["Right Arm"].RightGripAttachment
- BlackLightning.Parent = Character.HumanoidRootPart
- RedLightHand.Parent = Character["Right Arm"].RightGripAttachment
- RedLightning.Parent = Character.HumanoidRootPart
- Character.HumanoidRootPart.CFrame = CFramePos
- task.wait(1)
- VFXTweenRate(BlackLightning, 2)
- VFXTweenRate(BlackLightHand, .5)
- VFXTweenRate(RedLightning, 2)
- VFXTweenRate(RedLightHand, .5)
- UniEvents.EnableControls:FireClient(Player)
- local Counter = BlackFlashCDTime
- repeat task.wait(1)
- Counter -= 1
- until Counter <= 0
- BlackFlashOnCD = false
- Character:SetAttribute("BlackFlash", false)
- end)
- YujiEvents.Transform.OnServerEvent:Connect(function(Player)
- local Character = Player.Character
- local Humanoid = Character:WaitForChild("Humanoid")
- local Animator = Humanoid:WaitForChild("Animator")
- local TransformAnimation = YujiAnimations.TransformationCimatic
- local SkillAnimationTrack = Animator:LoadAnimation(TransformAnimation)
- if TransformationPlaying or TransformationCD then return end
- TransformationOn = true
- TransformationCD = true
- local SukunaSpeech = YujiSounds.SukunaTransformOpen:Clone()
- SukunaSpeech.Parent = Character.Head
- SukunaSpeech:Play()
- Debris:AddItem(SukunaSpeech,6)
- local SmokeEffect = YujiEffects.Smoke:Clone()
- SmokeEffect.Parent = Character.HumanoidRootPart.RootAttachment
- local RageHead = YujiAccessories.YujiRageHead:Clone()
- if Character:FindFirstChild("YujiRegularHead") then
- Character.YujiRegularHead:Destroy()
- end
- if Character:FindFirstChild("SukunaHead") then
- Character.SukunaHead:Destroy()
- end
- RageHead.Parent = Character
- TransformationPlaying = true
- UniEvents.DisableControls:FireClient(Player)
- SkillAnimationTrack:Play()
- YujiEvents.Transform:FireClient(Player)
- SkillAnimationTrack:GetMarkerReachedSignal("CameraShake"):Connect(function()
- UniEvents.ScreenShakeEvent:FireClient(Player)
- local WooshSound = YujiSounds.Woosh:Clone()
- WooshSound.Parent = Character["Right Arm"]
- WooshSound:Play()
- Debris:AddItem(WooshSound,2)
- local SukunaHead = YujiAccessories.SukunaHead:Clone()
- SukunaHead.Parent = Character
- RageHead.Handle.Transparency = 1
- repeat task.wait()
- until Character:FindFirstChild("SukunaHead")
- RageHead:Destroy()
- end)
- repeat task.wait()
- until not SkillAnimationTrack.IsPlaying
- SmokeEffect:Destroy()
- UniEvents.EnableControls:FireClient(Player)
- TransformationPlaying = false
- task.wait(TransformationDuration)
- local TransformEndAnimation = YujiAnimations.TransformEnd
- local SkillEndAnimationTrack = Animator:LoadAnimation(TransformEndAnimation)
- SkillEndAnimationTrack:Play()
- UniEvents.DisableControls:FireClient(Player)
- SkillEndAnimationTrack.KeyframeReached:Connect(function(KF)
- if KF == "ChangeFace" then
- local NormalHead = YujiAccessories.YujiRegularHead:Clone()
- NormalHead.Parent = Character
- Character:FindFirstChild("SukunaHead"):Destroy()
- end
- end)
- repeat task.wait()
- until not SkillEndAnimationTrack.IsPlaying
- UniEvents.EnableControls:FireClient(Player)
- TransformationOn = false
- task.wait(TransformationCDTime)
- TransformationCD = false
- end)
Advertisement
Add Comment
Please, Sign In to add comment