Advertisement
fusionfriends

Untitled

Jan 4th, 2021
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.73 KB | None | 0 0
  1. -- Decompiled with the Synapse X Luau decompiler.
  2.  
  3. local l__ReplicatedStorage__1 = game:GetService("ReplicatedStorage");
  4. local l__Players__2 = game:GetService("Players");
  5. local l__UserInputService__3 = game:GetService("UserInputService");
  6. local l__RunService__4 = game:GetService("RunService");
  7. local l__CollectionService__5 = game:GetService("CollectionService");
  8. local l__CombatFramework__6 = l__ReplicatedStorage__1:WaitForChild("CombatFramework");
  9. local v7 = require(l__CombatFramework__6.SimpleAnimator);
  10. local v8 = require(l__CombatFramework__6.RigLib);
  11. local v9 = require(l__CombatFramework__6.ToolBuilder);
  12. local v10 = require(l__CombatFramework__6.AnimationUtil);
  13. local v11 = require(script.Parent:WaitForChild("CameraShaker"));
  14. local v12 = require(game.Players.LocalPlayer:WaitForChild("PlayerScripts"):WaitForChild("PlayerModule")):GetControls();
  15. local v13 = require(script.Parent.Particle);
  16. local v14 = require(game.ReplicatedStorage:WaitForChild("Effect"));
  17. local l__RigControllerEvent__15 = l__ReplicatedStorage__1:WaitForChild("RigControllerEvent");
  18. local l__mouse__16 = l__Players__2.LocalPlayer:GetMouse();
  19. local u1 = l__Players__2.LocalPlayer.Character or l__Players__2.LocalPlayer.CharacterAdded:Wait();
  20. local u2 = nil;
  21. local u3 = nil;
  22. l__Players__2.LocalPlayer.CharacterAdded:Connect(function(p1)
  23. u1 = p1;
  24. u1:WaitForChild("Humanoid").Died:Connect(function()
  25. if u2 then
  26. u2:Destroy();
  27. u2 = nil;
  28. end;
  29. if u3 then
  30. u3:Stop();
  31. u3.Animation:Destroy();
  32. u3 = nil;
  33. end;
  34. end);
  35. end);
  36. u1:WaitForChild("Humanoid").Died:Connect(function()
  37. if u2 then
  38. u2:Destroy();
  39. u2 = nil;
  40. end;
  41. if u3 then
  42. u3:Stop();
  43. u3.Animation:Destroy();
  44. u3 = nil;
  45. end;
  46. end);
  47. local l__PlayerGui__17 = l__Players__2.LocalPlayer:WaitForChild("PlayerGui");
  48. local l__CurrentCamera__4 = workspace.CurrentCamera;
  49. local v18 = v11.new(Enum.RenderPriority.Camera.Value + 1, function(p2)
  50. l__CurrentCamera__4.CFrame = l__CurrentCamera__4.CFrame * p2;
  51. end);
  52. v18:Start();
  53. local v19 = {};
  54. v19.__index = v19;
  55. local u5 = {};
  56. function v19.new(p3, p4, p5, p6, p7, p8, p9, p10, p11)
  57. local v20 = setmetatable({}, v19);
  58. v20.backpack = p8;
  59. v20.humanoid = p3;
  60. if not p4 then
  61. return v20;
  62. end;
  63. if u2 then
  64. u2:Destroy();
  65. u2 = nil;
  66. end;
  67. if u3 then
  68. u3:Stop();
  69. u3.Animation:Destroy();
  70. u3 = nil;
  71. end;
  72. v20.weaponType = p11;
  73. v20.hitSound = p10;
  74. v20.currentWeaponModel = p9;
  75. v20.increment = 0;
  76. v20.anims = p4;
  77. v20.attacking = false;
  78. v20.blocking = false;
  79. v20.focusStart = 0;
  80. v20.blades = p6;
  81. v20.hitboxMagnitude = p7;
  82. v20.timeToNextBlock = 0;
  83. v20.timeToNextAttack = 0;
  84. v20.active = true;
  85. v20.equipped = true;
  86. if not u5[p5[1]] then
  87. u5[p5[1]] = require(p5[1]);
  88. end;
  89. v20.data = require(p5[1])[p5[2]];
  90. u1 = l__Players__2.LocalPlayer.Character or l__Players__2.LocalPlayer.CharacterAdded:Wait();
  91. u1:WaitForChild("Humanoid").Died:Connect(function()
  92. v20:destroy();
  93. end);
  94. v20.hitboxMagnitude = p7 * (u1:WaitForChild("HumanoidRootPart").Size.Y / 2);
  95. v20.message = Instance.new("BindableEvent");
  96. v20.messageConnection = v20.message.Event:Connect(function(p12, ...)
  97. local v21 = { ... };
  98. if p12 == "block" then
  99. if v21[1] == "stop" then
  100. v20:stopBlock(v21[2]);
  101. return;
  102. end;
  103. elseif p12 == "attack" then
  104. if v21[1] == "stop" and v20.currentAttackTrack then
  105. v20.currentAttackTrack:Stop();
  106. return;
  107. end;
  108. if v21[1] == "increment" then
  109. v20.increment = v21[2];
  110. end;
  111. end;
  112. end);
  113. v20.animator = v7.new(v20.humanoid, v20.anims);
  114. v20.animator:playAnimation("actions", "idle");
  115. v20.inputConnection = l__mouse__16.Button1Down:Connect(function()
  116. 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
  117. if v20.attacking then
  118. v20.currentAttackTrack:Stop();
  119. wait();
  120. end;
  121. v20.attacking = true;
  122. local v22, v23 = pcall(function()
  123. v20:attack();
  124. end);
  125. if not v22 then
  126. v20.attacking = false;
  127. end;
  128. return;
  129. end;
  130. end);
  131. local v24 = l__UserInputService__3.TouchEnabled and l__UserInputService__3.MouseEnabled == false;
  132. l__RunService__4:BindToRenderStep("COMBAT_FRAMEWORK_FOCUS_ADJUST", Enum.RenderPriority.Input.Value, function()
  133. 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
  134. if v20.blocking then
  135. v20.focusStart = tick();
  136. end;
  137. v20.humanoid.AutoRotate = false;
  138. if v24 then
  139. u1.HumanoidRootPart.CFrame = CFrame.new(u1.HumanoidRootPart.CFrame.p, u1.HumanoidRootPart.CFrame.p + l__CurrentCamera__4.CFrame.lookVector * Vector3.new(1, 0, 1));
  140. return;
  141. else
  142. local v25 = l__CurrentCamera__4:ScreenPointToRay(l__mouse__16.X, l__mouse__16.Y);
  143. local v26, v27 = workspace:FindPartOnRayWithIgnoreList(Ray.new(v25.Origin, v25.Direction * 500), l__CollectionService__5:GetTagged("ActiveRig"));
  144. local v28 = Vector3.new(v27.X, u1.HumanoidRootPart.CFrame.p.Y, v27.Z);
  145. if (v28 - u1.HumanoidRootPart.CFrame.p).magnitude < 2.75 then
  146. return;
  147. else
  148. u1.HumanoidRootPart.CFrame = CFrame.new(u1.HumanoidRootPart.CFrame.p, v28);
  149. return;
  150. end;
  151. end;
  152. end;
  153. v20.humanoid.AutoRotate = true;
  154. end);
  155. return v20;
  156. end;
  157. function v19.oldClientFix()
  158. if u2 then
  159. u2:Destroy();
  160. u2 = nil;
  161. end;
  162. if u3 then
  163. u3:Stop();
  164. u3.Animation:Destroy();
  165. u3 = nil;
  166. end;
  167. end;
  168. function v19.attack(p13)
  169. p13.focusStart = tick();
  170. p13.increment = p13.increment + 1;
  171. if #p13.anims.basic < p13.increment then
  172. p13.increment = 1;
  173. end;
  174. p13:fireCallback("attackStartCallback", p13.currentWeaponModel, p13.humanoid.Parent, p13.increment);
  175. v18:Shake(v11.Presets.Bump);
  176. p13.currentAttackTrack = p13.animator:playAnimation("basic", p13.increment);
  177. p13.timeToNextAttack = tick() + p13.currentAttackTrack.Length * 0.7;
  178. local u6 = p13.data.blockBrokenIncrements[p13.increment];
  179. v8.wrapAttackAnimationAsync(p13.currentAttackTrack, p13.humanoid.Parent, p13.blades, p13.hitboxMagnitude, function(p14)
  180. l__RigControllerEvent__15:FireServer("hit", p14, p13.increment);
  181. local v29 = false;
  182. local v30 = false;
  183. local v31 = {};
  184. for v32, v33 in pairs(p14) do
  185. if v33.Parent:FindFirstChild("Head") and not v31[v33.Parent.Head] then
  186. if l__CollectionService__5:HasTag(v33.Parent, "BlockingRig") then
  187. v30 = true;
  188. end;
  189. if not l__CollectionService__5:HasTag(u1, "Buso") and v33.Parent.LowerTorso:FindFirstChild("Logia") then
  190. v29 = true;
  191. end;
  192. v31[v33.Parent.Head] = true;
  193. end;
  194. end;
  195. if not v29 then
  196. if not v30 then
  197. v13.play(v13.particleType.Hit, p14[1].Position, p13.hitSound);
  198. return;
  199. end;
  200. else
  201. return;
  202. end;
  203. if u6 then
  204. v13.play(v13.particleType.Hit, p14[1].Position, "ShieldBreak");
  205. return;
  206. end;
  207. v13.play(v13.particleType.Block, p14[1].Position);
  208. end);
  209. local l__increment__7 = p13.increment;
  210. delay(0.75, function()
  211. if p13.increment == l__increment__7 then
  212. p13.increment = 0;
  213. end;
  214. end);
  215. if p13.currentWeaponModel:FindFirstChild("Right") or p13.currentWeaponModel:FindFirstChild("Left") then
  216. p13:fireCallback("attackStopCallback", p13.currentWeaponModel);
  217. end;
  218. p13.currentAttackTrack = nil;
  219. p13.attacking = false;
  220. end;
  221. function v19.fireCallback(p15, p16, ...)
  222. if typeof(p15.data[p16]) == "function" then
  223. p15.data[p16](...);
  224. end;
  225. end;
  226. function v19.startBlock(p17)
  227. if tick() < p17.timeToNextBlock then
  228. return;
  229. end;
  230. if p17.attacking then
  231. return;
  232. end;
  233. p17.blocking = true;
  234. p17.currentBlockTrack = p17.animator:playAnimation("actions", "block");
  235. p17.currentBlockTrack.Stopped:Wait();
  236. p17.blocking = false;
  237. end;
  238. function v19.stopBlock(p18, p19)
  239. if not p18.blocking then
  240. return;
  241. end;
  242. if not p19 then
  243. p19 = 0;
  244. end;
  245. p18.timeToNextBlock = tick() + p19;
  246. p18.currentBlockTrack:Stop();
  247. end;
  248. function v19.addWeaponToBackpack(p20, p21)
  249. p20.backpack[p21.name] = p21;
  250. end;
  251. function v19.removeWeaponFromBackpack(p22, p23)
  252. p22.backpack[p23] = nil;
  253. end;
  254. function v19.changeWeapon(p24, p25)
  255. if p24.equipped then
  256. p24:unequipWeapon();
  257. end;
  258. local v34 = p24.backpack[p25];
  259. if not v34 then
  260. return;
  261. end;
  262. local v35 = l__Players__2.LocalPlayer:WaitForChild("WeaponAssetCache"):FindFirstChild(v34.name);
  263. if not v35 then
  264. return;
  265. end;
  266. if u2 then
  267. u2:Destroy();
  268. u2 = nil;
  269. end;
  270. if u3 then
  271. u3:Stop();
  272. u3.Animation:Destroy();
  273. u3 = nil;
  274. end;
  275. u2 = v9.attachTool(p24.humanoid.Parent, v35, v34.offsets, nil, v34.collisionGroup, v34.weldTool);
  276. if u3 then
  277. u3:Stop();
  278. end;
  279. u3 = v10.load(p24.humanoid, v34.idle);
  280. u3:Play();
  281. l__RigControllerEvent__15:FireServer("weaponChange", p25);
  282. end;
  283. function v19.unequipWeapon(p26)
  284. if p26.equipped then
  285. l__RigControllerEvent__15:FireServer("unequipWeapon", p26.currentWeaponModel.Name);
  286. if u2 then
  287. u2:Destroy();
  288. u2 = nil;
  289. end;
  290. if u3 then
  291. u3:Stop();
  292. u3.Animation:Destroy();
  293. u3 = nil;
  294. end;
  295. if p26.currentWeaponModel then
  296. p26.currentWeaponModel:Destroy();
  297. end;
  298. p26.animator:stopAllAnimations();
  299. p26.humanoid.AutoRotate = true;
  300. if p26.inputConnection then
  301. p26.inputConnection:Disconnect();
  302. p26.inputConnection = nil;
  303. end;
  304. l__RunService__4:UnbindFromRenderStep("COMBAT_FRAMEWORK_FOCUS_ADJUST");
  305. p26.animator:stopAnimation("actions", "idle");
  306. end;
  307. p26.equipped = false;
  308. end;
  309. function v19.destroy(p27)
  310. if p27.equipped then
  311. p27:unequipWeapon();
  312. end;
  313. if p27.active then
  314. p27.messageConnection:Disconnect();
  315. p27.animator:destroy();
  316. p27.message:Destroy();
  317. p27.active = false;
  318. end;
  319. end;
  320. return v19;
  321.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement