Guest User

Bridge Duel

a guest
May 5th, 2025
483
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.30 KB | None | 0 0
  1. local KILL_AURA = true;
  2. local BOW_AURA = true; -- This is buggy and bad
  3.  
  4. local ANTI_AIM = true; -- Doesn't give an advantage just for visuals (click f5)
  5. local ANTI_KNOCKBACK = true; -- Working for the most part
  6.  
  7. -- Services
  8. local ReplicatedStorage = game:GetService("ReplicatedStorage");
  9. local RunService = game:GetService("RunService");
  10. local Players = game:GetService("Players");
  11. local Workspace = game:GetService("Workspace");
  12.  
  13. -- Variables
  14. local Modules = ReplicatedStorage.Modules;
  15. local Constants = ReplicatedStorage.Constants;
  16.  
  17. local LocalPlayer = Players.LocalPlayer;
  18. local Camera = Workspace.CurrentCamera;
  19.  
  20. local Zero = Vector3.zero;
  21.  
  22. -- Modules
  23. local BlinkClient = require(ReplicatedStorage.Blink.Client);
  24. local KnitClient = require(ReplicatedStorage.Modules.Knit.Client);
  25.  
  26. local EntityModule = require(Modules.Entity);
  27.  
  28. local RangedModule = require(Constants.Ranged);
  29. local MeleeModule = require(Constants.Melee);
  30.  
  31. -- Blink
  32. local ItemAction = BlinkClient.item_action;
  33. local AttackAction = ItemAction.attack_entity.fire;
  34.  
  35. -- Knit
  36. local ViewmodelController = KnitClient.GetController("ViewmodelController");
  37.  
  38. -- Functions
  39. local GarbageCollection = { }; do
  40. local Gc = getgc(true);
  41.  
  42. function GarbageCollection.Get(Identifier)
  43. local Valid = { };
  44.  
  45. for _, Object in Gc do
  46. local IsValid = typeof(Object) == "table" and rawget(Object, Identifier);
  47.  
  48. if (not IsValid) then
  49. continue;
  50. end
  51.  
  52. table.insert(Valid, Object);
  53. end
  54.  
  55. return Valid;
  56. end
  57. end
  58.  
  59. local Trove = { }; do
  60. local Components = GarbageCollection.Get("_trove");
  61.  
  62. function Trove.GetComponent(Name)
  63. for _, Component in Components do
  64. local Metatable = getrawmetatable(Component);
  65. local ToString = Metatable and Metatable.__tostring;
  66.  
  67. if (not ToString) then
  68. continue;
  69. end
  70.  
  71. local ComponentName = string.match(ToString(Component), "Component<(.+)>");
  72.  
  73. if (ComponentName == Name) then
  74. return Component;
  75. end
  76. end
  77. end
  78. end
  79.  
  80. local Sword = { }; do
  81. Sword.Time = tick();
  82.  
  83. function Sword.GetTarget(Range)
  84. local Closest, ClosestDistance = nil, Range;
  85.  
  86. for _, Player in Players:GetChildren() do
  87. if (Player == LocalPlayer) then
  88. continue;
  89. end
  90.  
  91. local Character = Player.Character;
  92. local Root = Character and Character:FindFirstChild("HumanoidRootPart");
  93.  
  94. local LocalCharacter = LocalPlayer.Character;
  95. local LocalRoot = LocalCharacter and LocalCharacter:FindFirstChild("HumanoidRootPart");
  96.  
  97. if (not Root) or (not LocalRoot) then
  98. continue;
  99. end
  100.  
  101. local Distance = (Root.Position - LocalRoot.Position).Magnitude;
  102.  
  103. if (ClosestDistance > Distance) then
  104. Closest = Character;
  105. ClosestDistance = Distance;
  106. end
  107. end
  108.  
  109. return Closest;
  110. end
  111.  
  112. function Sword.Swing(Target)
  113. local TargetData = EntityModule.FindByCharacter(Target);
  114. local SwordComponent = TargetData and Trove.GetComponent("Sword");
  115.  
  116. if (not SwordComponent) then
  117. return;
  118. end
  119.  
  120. local SwordName = SwordComponent.Instance.Name;
  121. local SwingData = {
  122. ["weapon_name"] = SwordName,
  123. ["target_entity_id"] = TargetData.Id,
  124. ["is_crit"] = true,
  125. ["extra"] = {
  126. ["rizz"] = "No.",
  127. ["sigma"] = "The...",
  128. ["those"] = Workspace.Name == "Ok",
  129. },
  130. };
  131.  
  132. AttackAction(SwingData);
  133.  
  134. setthreadidentity(2);
  135. ViewmodelController:PlayAnimation(SwordName);
  136. setthreadidentity(8);
  137.  
  138. Sword.Time = tick();
  139. end
  140. end
  141.  
  142. local Bow = { }; do
  143. Bow.Time = tick();
  144.  
  145. function Bow.Fire(Origin, End) -- This is super buggy, icba fixing it since it's not even that useful anyway
  146. local BowComponent = Trove.GetComponent("Bow");
  147. local Communication = BowComponent and BowComponent._comm;
  148.  
  149. if (not Communication) then
  150. return;
  151. end
  152.  
  153. local Speed = RangedModule.BOW_SPEED;
  154. local Direction = CFrame.lookAt(Origin, End).LookVector * Speed;
  155. Communication:GetFunction("Fire")(Origin + Direction, 0.7):catch(warn);
  156.  
  157. Bow.Time = tick();
  158. end
  159. end
  160.  
  161. local Character = { }; do
  162. Character.Connections = { };
  163.  
  164. function Character.New(Object)
  165. if (not Object) then
  166. return;
  167. end
  168.  
  169. for _, Connection in Character.Connections do
  170. Connection:Disconnect();
  171. end
  172.  
  173. local Root = Object:WaitForChild("HumanoidRootPart", 9e9);
  174.  
  175. Character.Connections.Changed = Root:GetPropertyChangedSignal("Velocity"):Connect(function()
  176. if (ANTI_KNOCKBACK) then
  177. Root.Velocity = Zero;
  178. end
  179. end)
  180. end
  181. end
  182.  
  183. -- Connections
  184. do
  185. RunService.RenderStepped:Connect(function()
  186. local Origin = Camera.CFrame.Position;
  187. local SwordTarget, BowTarget = Sword.GetTarget(16), Sword.GetTarget(50);
  188.  
  189. if (SwordTarget and tick() - Sword.Time >= 0.1) and KILL_AURA then
  190. Sword.Swing(SwordTarget);
  191. end
  192.  
  193. if (tick() - Bow.Time >= 1.8) and BOW_AURA then
  194. local Root = BowTarget and BowTarget:FindFirstChild("HumanoidRootPart");
  195.  
  196. if (Root) then
  197. Bow.Fire(Origin, Root.Position);
  198. end
  199. end
  200. end)
  201.  
  202. Character.New(LocalPlayer.Character);
  203. LocalPlayer.CharacterAdded:Connect(Character.New);
  204. end
  205.  
  206. -- Hooks
  207. do
  208. local Angles = 0; local LookAt = nil; LookAt = hookfunction(getrenv().CFrame.lookAt, function(Position, At)
  209. local Caller = getcallingscript();
  210. local ReturnValue = LookAt(Position, At);
  211.  
  212. if (tostring(Caller) == "ClientRuntime") and ANTI_AIM then
  213. ReturnValue *= CFrame.Angles(Angles, -Angles, -Angles); Angles += 5;
  214. end
  215.  
  216. return ReturnValue;
  217. end)
  218.  
  219. hookfunction(MeleeModule.isInRange, function()
  220. return true;
  221. end)
  222. end
  223. -- More scripts: t.me/arceusxscripts
Advertisement
Add Comment
Please, Sign In to add comment