Advertisement
CaliberMag

Untitled

Dec 28th, 2020
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.70 KB | None | 0 0
  1. getgenv().Multiplier = 1; -- default idk
  2.  
  3. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  4.  
  5. local Player = game:GetService'Players'.LocalPlayer
  6. local PlayerProfile = ReplicatedStorage:WaitForChild'Profiles':WaitForChild(Player.Name)
  7.  
  8. local Database = ReplicatedStorage.Database;
  9.  
  10. local Event = ReplicatedStorage.Event;
  11. local Function = ReplicatedStorage.Function;
  12.  
  13. local SwordMethod = '';
  14. local ExploitCallKey = tostring(math.random(-1000,1000)) .. string.char(math.random(0,100))
  15. local CombatModule;
  16.  
  17. local HitInfo = {
  18. Hitting = {};
  19. HitCounter = {};
  20. Waiting = {};
  21. };
  22.  
  23. local function SetCombatModule()
  24. for i,v in next, getgc(true) do
  25. if type(v) == 'table' and rawget(v, 'DamageArea') then
  26. CombatModule = v;
  27. break
  28. end
  29. end
  30. end
  31. SetCombatModule()
  32.  
  33. if not CombatModule then
  34. repeat
  35. wait(1)
  36. SetCombatModule()
  37. until CombatModule
  38. end
  39.  
  40. local function SetSwordSkill()
  41. local Equipped = PlayerProfile.Equip
  42. local Left,Right = Equipped.Left.Value, Equipped.Right.Value;
  43.  
  44. if (Left ~= 0 and Right ~= 0) then
  45. SwordMethod = 'Whirlwind Spin';
  46. else
  47. local InventoryID = Left == 0 and Right or Right == 0 and Left;
  48. if (InventoryID) then
  49. local Name,Type;
  50.  
  51. for _,Item in next, PlayerProfile.Inventory:GetChildren() do
  52. if (Item.Value == InventoryID) then
  53. Name = Item.Name;
  54. end
  55. end
  56.  
  57. local Item = Database.Items:FindFirstChild(Name)
  58. if (Item) then
  59. Type = Item:FindFirstChild('Class') and Item.Class.Value;
  60. end
  61.  
  62. Type = Type == '1HSword' and 'SingleSword' or Type
  63.  
  64. if (Type) then
  65. for _,Skill in next, Database.Skills:GetChildren() do
  66. if (Skill:FindFirstChild('Class') and Skill.Class.Value == Type) then
  67. SwordMethod = Skill.Name;
  68. end
  69. end
  70. else
  71. SwordMethod = 'Leaping Slash';
  72. end
  73. end
  74. end
  75.  
  76. Event:FireServer('Skills',{'UseSkill',SwordMethod}) -- imagine working because missing arg
  77. end
  78.  
  79. local Equipped = PlayerProfile.Equip
  80. Equipped.Left.Changed:Connect(SetSwordSkill)
  81. Equipped.Right.Changed:Connect(SetSwordSkill)
  82. SetSwordSkill();
  83.  
  84. local ToggleValue = false;
  85. local SwordSkillsValue = false;
  86.  
  87. local UILibrary = loadstring(game:HttpGet"https://pastebin.com/raw/deeWt6sx")()
  88. local MainWindow = UILibrary:MakeWindow('Main')
  89.  
  90. local Toggled = MainWindow:addCheckbox('Multiplier Toggle')
  91. local MultiplierTextbox = MainWindow:addTextBoxF('Damage Multiplier', function(Text)
  92. getgenv().Multiplier = tonumber(Text) and math.max(tonumber(Text), 1) or 1;
  93. end)
  94. local KillAura = MainWindow:addCheckbox('Kill Aura')
  95. local InfStamina = MainWindow:addCheckbox('Infinite Stamina')
  96. local SwordSkills = MainWindow:addCheckbox('Use Sword Skills')
  97. MainWindow:addLabel("Made by whomever#7779", 'Center');
  98.  
  99. if (not getrawmetatable or not setreadonly) then
  100. print("Exploit isn't supported.");
  101. repeat wait(5) until nil;
  102. end
  103.  
  104. local Meta = getrawmetatable(game)
  105. local Namecall = Meta.__namecall
  106.  
  107. setreadonly(Meta, false);
  108.  
  109. local function GetCooldown()
  110. return getgenv().SB2_WAIT_TIME or 1.5;
  111. end
  112.  
  113. local function GetSwordMethod()
  114. local Method = SwordMethod;
  115. if (SwordSkillsValue == false) then
  116. Method = nil;
  117. end
  118. return Method;
  119. end
  120.  
  121. local function Invalid(Target)
  122. if (Target == nil) then
  123. return true
  124. end
  125.  
  126. local PrimaryPartCF = Target:GetPrimaryPartCFrame()
  127. local Root = Player.Character:WaitForChild('HumanoidRootPart')
  128.  
  129. if (PrimaryPartCF.Position - Root.Position).Magnitude > 20 then
  130. return true
  131. end
  132.  
  133. if (Player.Character.Entity.Health.Value <= Player.Character.Entity.Health.MinValue) then
  134. return true
  135. end
  136.  
  137. if (Target.Entity.Health.Value <= Target.Entity.Health.MinValue) then
  138. return true
  139. end
  140.  
  141. return false
  142. end
  143.  
  144. local function HitMob(Target)
  145.  
  146. if (not HitInfo.HitCounter[Target]) then
  147. HitInfo.HitCounter[Target] = 0;
  148. end;
  149.  
  150. local Normal = (SwordSkillsValue == false)
  151. local HitAmount = 10
  152. if (HitInfo.HitCounter[Target] % HitAmount == 0 and HitInfo.HitCounter[Target] > 0 and Normal) then
  153. wait(GetCooldown())
  154. end
  155.  
  156. coroutine.wrap(Event.FireServer)(
  157. Event,
  158. 'Combat',
  159. {'\204','\214','\177','\251'},
  160. {
  161. 'Attack',
  162. GetSwordMethod(),
  163. 1,
  164. Target
  165. },
  166. ExploitCallKey
  167. )
  168. end
  169.  
  170. local function AuraHit()
  171. local Root = Player.Character:WaitForChild('HumanoidRootPart', 2)
  172. local Hits = ToggleValue and math.clamp(getgenv().Multiplier, 1, 50) or 1;
  173. for _ = 1, Hits do -- not too laggy
  174. for _,Mob in next, workspace.Mobs:GetChildren() do
  175. local PrimaryPart = Mob:IsA'Model' and Mob.PrimaryPart
  176. local Distance = PrimaryPart and (Root.Position - PrimaryPart.Position).Magnitude
  177. if (Distance and Distance <= 20 and (not Invalid(Mob))) then
  178. coroutine.wrap(HitMob)(Mob)
  179. end
  180. end
  181. end
  182. end
  183.  
  184. game:GetService("RunService").Heartbeat:Connect(function()
  185. ToggleValue = Toggled.Checked.Value
  186. SwordSkillsValue = SwordSkills.Checked.Value
  187.  
  188. if (KillAura.Checked.Value) then
  189. spawn(AuraHit);
  190. end
  191.  
  192. if (InfStamina.Checked.Value) then
  193. if Player.Character then
  194. Player.Character:WaitForChild("Entity").Stamina.Value = 100
  195. end
  196. coroutine.wrap(Event.FireServer)(Event, 'Actions', {'Sprint','Disabled'})
  197. end
  198. end)
  199.  
  200. Meta.__namecall = function(self,...)
  201. local Args = {...};
  202. local Service = Args[1];
  203. local ActionInfo = Args[2];
  204. local AttackInfo = Args[3];
  205.  
  206. local IsExploitCall = Args[4] == ExploitCallKey;
  207.  
  208. local IsCombatService = (Service and Service == 'Combat');
  209. local IsAttack = ((AttackInfo and type(AttackInfo) == 'table') and AttackInfo[1] == 'Attack');
  210.  
  211. local IsActionService = (Service and Service == 'Actions');
  212. local IsSprintStep = ((ActionInfo and type(ActionInfo) == 'table') and ActionInfo[2] == 'Step');
  213.  
  214. local Method = getnamecallmethod()
  215.  
  216. if (self == Event and IsCombatService and IsAttack) then
  217. local Mob = Args[3][4]
  218. if (IsExploitCall == false and (not HitInfo.Waiting[Mob])) then
  219. local HitsLeft = ToggleValue and getgenv().Multiplier or 1
  220.  
  221. if (HitInfo.Hitting[Mob]) then
  222. HitInfo.Waiting[Mob] = true; -- We still need a queue.
  223. repeat
  224. wait()
  225. until not HitInfo.Hitting[Mob];
  226. wait(GetCooldown())
  227. HitInfo.Waiting[Mob] = false;
  228. end
  229.  
  230. coroutine.wrap(function()
  231. HitInfo.Hitting[Mob] = true;
  232. for i = 1, HitsLeft do
  233. if Invalid(Mob) then break end;
  234. -- Call it on the same thread, if it needs to yield, it won't fuck with HitInfo.Hitting
  235. HitMob(Mob);
  236. end
  237. HitInfo.Hitting[Mob] = false;
  238. end)()
  239.  
  240. return nil;
  241. end
  242. elseif (self == Event and IsActionService and IsSprintStep) then
  243. return;
  244. elseif (Method == 'GetTouchingParts' and string.lower(self.Name) == 'blade') then
  245. local Result = Namecall(self,...)
  246. for _,Mob in next, game.GetChildren(workspace.Mobs) do
  247. table.insert(Result, Mob.PrimaryPart)
  248. end
  249. return Result;
  250. end
  251.  
  252. return Namecall(self,...)
  253. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement