Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Decompiled with the Synapse X Luau decompiler.
- local l__ReplicatedStorage__1 = game:GetService("ReplicatedStorage");
- local l__Players__2 = game:GetService("Players");
- local l__UserInputService__3 = game:GetService("UserInputService");
- local l__RunService__4 = game:GetService("RunService");
- local l__CollectionService__5 = game:GetService("CollectionService");
- local l__CombatFramework__6 = l__ReplicatedStorage__1:WaitForChild("CombatFramework");
- local v7 = require(l__CombatFramework__6.SimpleAnimator);
- local v8 = require(l__CombatFramework__6.RigLib);
- local v9 = require(l__CombatFramework__6.ToolBuilder);
- local v10 = require(l__CombatFramework__6.AnimationUtil);
- local v11 = require(script.Parent:WaitForChild("CameraShaker"));
- local v12 = require(game.Players.LocalPlayer:WaitForChild("PlayerScripts"):WaitForChild("PlayerModule")):GetControls();
- local v13 = require(script.Parent.Particle);
- local v14 = require(game.ReplicatedStorage:WaitForChild("Effect"));
- local l__RigControllerEvent__15 = l__ReplicatedStorage__1:WaitForChild("RigControllerEvent");
- local l__mouse__16 = l__Players__2.LocalPlayer:GetMouse();
- local u1 = l__Players__2.LocalPlayer.Character or l__Players__2.LocalPlayer.CharacterAdded:Wait();
- local u2 = nil;
- local u3 = nil;
- l__Players__2.LocalPlayer.CharacterAdded:Connect(function(p1)
- u1 = p1;
- u1:WaitForChild("Humanoid").Died:Connect(function()
- if u2 then
- u2:Destroy();
- u2 = nil;
- end;
- if u3 then
- u3:Stop();
- u3.Animation:Destroy();
- u3 = nil;
- end;
- end);
- end);
- u1:WaitForChild("Humanoid").Died:Connect(function()
- if u2 then
- u2:Destroy();
- u2 = nil;
- end;
- if u3 then
- u3:Stop();
- u3.Animation:Destroy();
- u3 = nil;
- end;
- end);
- local l__PlayerGui__17 = l__Players__2.LocalPlayer:WaitForChild("PlayerGui");
- local l__CurrentCamera__4 = workspace.CurrentCamera;
- local v18 = v11.new(Enum.RenderPriority.Camera.Value + 1, function(p2)
- l__CurrentCamera__4.CFrame = l__CurrentCamera__4.CFrame * p2;
- end);
- v18:Start();
- local v19 = {};
- v19.__index = v19;
- local u5 = {};
- function v19.new(p3, p4, p5, p6, p7, p8, p9, p10, p11)
- local v20 = setmetatable({}, v19);
- v20.backpack = p8;
- v20.humanoid = p3;
- if not p4 then
- return v20;
- end;
- if u2 then
- u2:Destroy();
- u2 = nil;
- end;
- if u3 then
- u3:Stop();
- u3.Animation:Destroy();
- u3 = nil;
- end;
- v20.weaponType = p11;
- v20.hitSound = p10;
- v20.currentWeaponModel = p9;
- v20.increment = 0;
- v20.anims = p4;
- v20.attacking = false;
- v20.blocking = false;
- v20.focusStart = 0;
- v20.blades = p6;
- v20.hitboxMagnitude = p7;
- v20.timeToNextBlock = 0;
- v20.timeToNextAttack = 0;
- v20.active = true;
- v20.equipped = true;
- if not u5[p5[1]] then
- u5[p5[1]] = require(p5[1]);
- end;
- v20.data = require(p5[1])[p5[2]];
- u1 = l__Players__2.LocalPlayer.Character or l__Players__2.LocalPlayer.CharacterAdded:Wait();
- u1:WaitForChild("Humanoid").Died:Connect(function()
- v20:destroy();
- end);
- v20.hitboxMagnitude = p7 * (u1:WaitForChild("HumanoidRootPart").Size.Y / 2);
- v20.message = Instance.new("BindableEvent");
- v20.messageConnection = v20.message.Event:Connect(function(p12, ...)
- local v21 = { ... };
- if p12 == "block" then
- if v21[1] == "stop" then
- v20:stopBlock(v21[2]);
- return;
- end;
- elseif p12 == "attack" then
- if v21[1] == "stop" and v20.currentAttackTrack then
- v20.currentAttackTrack:Stop();
- return;
- end;
- if v21[1] == "increment" then
- v20.increment = v21[2];
- end;
- end;
- end);
- v20.animator = v7.new(v20.humanoid, v20.anims);
- v20.animator:playAnimation("actions", "idle");
- v20.inputConnection = l__mouse__16.Button1Down:Connect(function()
- if not v20.blocking and not (tick() <= v20.timeToNextAttack) and not (u1.Stun.Value > 0) and not u1.Humanoid.Sit and not u1.Busy.Value and not _G.mobileSelectionFrame and not u1:FindFirstChild("Phoenix") and not u1:FindFirstChild("Dragon") then
- if v20.attacking then
- v20.currentAttackTrack:Stop();
- wait();
- end;
- v20.attacking = true;
- local v22, v23 = pcall(function()
- v20:attack();
- end);
- if not v22 then
- v20.attacking = false;
- end;
- return;
- end;
- end);
- local v24 = l__UserInputService__3.TouchEnabled and l__UserInputService__3.MouseEnabled == false;
- l__RunService__4:BindToRenderStep("COMBAT_FRAMEWORK_FOCUS_ADJUST", Enum.RenderPriority.Input.Value, function()
- if (not (tick() - v20.focusStart > 5) or v20.blocking) and not v20.humanoid.Sit and not (u1.Stun.Value > 0) and not u1.Busy.Value and not u1:FindFirstChild("Phoenix") and not u1:FindFirstChild("Dragon") then
- if v20.blocking then
- v20.focusStart = tick();
- end;
- v20.humanoid.AutoRotate = false;
- if v24 then
- u1.HumanoidRootPart.CFrame = CFrame.new(u1.HumanoidRootPart.CFrame.p, u1.HumanoidRootPart.CFrame.p + l__CurrentCamera__4.CFrame.lookVector * Vector3.new(1, 0, 1));
- return;
- else
- local v25 = l__CurrentCamera__4:ScreenPointToRay(l__mouse__16.X, l__mouse__16.Y);
- local v26, v27 = workspace:FindPartOnRayWithIgnoreList(Ray.new(v25.Origin, v25.Direction * 500), l__CollectionService__5:GetTagged("ActiveRig"));
- local v28 = Vector3.new(v27.X, u1.HumanoidRootPart.CFrame.p.Y, v27.Z);
- if (v28 - u1.HumanoidRootPart.CFrame.p).magnitude < 2.75 then
- return;
- else
- u1.HumanoidRootPart.CFrame = CFrame.new(u1.HumanoidRootPart.CFrame.p, v28);
- return;
- end;
- end;
- end;
- v20.humanoid.AutoRotate = true;
- end);
- return v20;
- end;
- function v19.oldClientFix()
- if u2 then
- u2:Destroy();
- u2 = nil;
- end;
- if u3 then
- u3:Stop();
- u3.Animation:Destroy();
- u3 = nil;
- end;
- end;
- function v19.attack(p13)
- p13.focusStart = tick();
- p13.increment = p13.increment + 1;
- if #p13.anims.basic < p13.increment then
- p13.increment = 1;
- end;
- p13:fireCallback("attackStartCallback", p13.currentWeaponModel, p13.humanoid.Parent, p13.increment);
- v18:Shake(v11.Presets.Bump);
- p13.currentAttackTrack = p13.animator:playAnimation("basic", p13.increment);
- p13.timeToNextAttack = tick() + p13.currentAttackTrack.Length * 0.7;
- local u6 = p13.data.blockBrokenIncrements[p13.increment];
- v8.wrapAttackAnimationAsync(p13.currentAttackTrack, p13.humanoid.Parent, p13.blades, p13.hitboxMagnitude, function(p14)
- l__RigControllerEvent__15:FireServer("hit", p14, p13.increment);
- local v29 = false;
- local v30 = false;
- local v31 = {};
- for v32, v33 in pairs(p14) do
- if v33.Parent:FindFirstChild("Head") and not v31[v33.Parent.Head] then
- if l__CollectionService__5:HasTag(v33.Parent, "BlockingRig") then
- v30 = true;
- end;
- if not l__CollectionService__5:HasTag(u1, "Buso") and v33.Parent.LowerTorso:FindFirstChild("Logia") then
- v29 = true;
- end;
- v31[v33.Parent.Head] = true;
- end;
- end;
- if not v29 then
- if not v30 then
- v13.play(v13.particleType.Hit, p14[1].Position, p13.hitSound);
- return;
- end;
- else
- return;
- end;
- if u6 then
- v13.play(v13.particleType.Hit, p14[1].Position, "ShieldBreak");
- return;
- end;
- v13.play(v13.particleType.Block, p14[1].Position);
- end);
- local l__increment__7 = p13.increment;
- delay(0.75, function()
- if p13.increment == l__increment__7 then
- p13.increment = 0;
- end;
- end);
- if p13.currentWeaponModel:FindFirstChild("Right") or p13.currentWeaponModel:FindFirstChild("Left") then
- p13:fireCallback("attackStopCallback", p13.currentWeaponModel);
- end;
- p13.currentAttackTrack = nil;
- p13.attacking = false;
- end;
- function v19.fireCallback(p15, p16, ...)
- if typeof(p15.data[p16]) == "function" then
- p15.data[p16](...);
- end;
- end;
- function v19.startBlock(p17)
- if tick() < p17.timeToNextBlock then
- return;
- end;
- if p17.attacking then
- return;
- end;
- p17.blocking = true;
- p17.currentBlockTrack = p17.animator:playAnimation("actions", "block");
- p17.currentBlockTrack.Stopped:Wait();
- p17.blocking = false;
- end;
- function v19.stopBlock(p18, p19)
- if not p18.blocking then
- return;
- end;
- if not p19 then
- p19 = 0;
- end;
- p18.timeToNextBlock = tick() + p19;
- p18.currentBlockTrack:Stop();
- end;
- function v19.addWeaponToBackpack(p20, p21)
- p20.backpack[p21.name] = p21;
- end;
- function v19.removeWeaponFromBackpack(p22, p23)
- p22.backpack[p23] = nil;
- end;
- function v19.changeWeapon(p24, p25)
- if p24.equipped then
- p24:unequipWeapon();
- end;
- local v34 = p24.backpack[p25];
- if not v34 then
- return;
- end;
- local v35 = l__Players__2.LocalPlayer:WaitForChild("WeaponAssetCache"):FindFirstChild(v34.name);
- if not v35 then
- return;
- end;
- if u2 then
- u2:Destroy();
- u2 = nil;
- end;
- if u3 then
- u3:Stop();
- u3.Animation:Destroy();
- u3 = nil;
- end;
- u2 = v9.attachTool(p24.humanoid.Parent, v35, v34.offsets, nil, v34.collisionGroup, v34.weldTool);
- if u3 then
- u3:Stop();
- end;
- u3 = v10.load(p24.humanoid, v34.idle);
- u3:Play();
- l__RigControllerEvent__15:FireServer("weaponChange", p25);
- end;
- function v19.unequipWeapon(p26)
- if p26.equipped then
- l__RigControllerEvent__15:FireServer("unequipWeapon", p26.currentWeaponModel.Name);
- if u2 then
- u2:Destroy();
- u2 = nil;
- end;
- if u3 then
- u3:Stop();
- u3.Animation:Destroy();
- u3 = nil;
- end;
- if p26.currentWeaponModel then
- p26.currentWeaponModel:Destroy();
- end;
- p26.animator:stopAllAnimations();
- p26.humanoid.AutoRotate = true;
- if p26.inputConnection then
- p26.inputConnection:Disconnect();
- p26.inputConnection = nil;
- end;
- l__RunService__4:UnbindFromRenderStep("COMBAT_FRAMEWORK_FOCUS_ADJUST");
- p26.animator:stopAnimation("actions", "idle");
- end;
- p26.equipped = false;
- end;
- function v19.destroy(p27)
- if p27.equipped then
- p27:unequipWeapon();
- end;
- if p27.active then
- p27.messageConnection:Disconnect();
- p27.animator:destroy();
- p27.message:Destroy();
- p27.active = false;
- end;
- end;
- return v19;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement