local replicated_storage = game:GetService("ReplicatedStorage");
local run_service = game:GetService("RunService");
local workspace = game:GetService("Workspace");
local players = game:GetService("Players");
local local_player = players.LocalPlayer;
local main_event = replicated_storage.MainEvent;
local gun_handler = require(replicated_storage.Modules.GunHandler);
local main_module = require(replicated_storage.MainModule);
local vehicles = workspace.Vehicles;
table.insert(main_module.Ignored, vehicles);
local ragebot_delay, last_ran = 0, 0;
local function is_visible(part: BasePart, handle: BasePart)
local raycast_params = RaycastParams.new();
raycast_params.FilterType = Enum.RaycastFilterType.Exclude;
raycast_params.IgnoreWater = true;
raycast_params.FilterDescendantsInstances = { local_player.Character, workspace.Bush, workspace.Ignored, vehicles };
local origin = handle.Position;
local direction = part.Position - origin;
local result = workspace:Raycast(origin, direction, raycast_params);
if (not result) then
return (false);
end
return (result.Instance:IsDescendantOf(part.Parent));
end
local function closest_larp(max_range: number, handle: BasePart)
local closest_part, closest_distance = nil, max_range;
for _, player in (players:GetPlayers()) do
if (player == local_player) then
continue;
end
local character = player.Character;
if (not character) or (character:FindFirstChild("BodyEffects") and character.BodyEffects["K.O"].Value) or (character:FindFirstChildOfClass("ForceField")) then
continue;
end
local head = character:FindFirstChild("Head");
if (not head) then
continue;
end
if (not is_visible(head, handle)) then
continue;
end
local distance = (handle.Position - head.Position).magnitude;
if (distance < closest_distance) then
closest_part = head;
closest_distance = distance;
end
end
return (closest_part);
end
run_service.RenderStepped:Connect(function()
local tool = local_player.Character:FindFirstChildWhichIsA("Tool");
local now = tick();
if (tool) and (tool:FindFirstChild("Handle")) and (now - last_ran > ragebot_delay) then
local shooting_cooldown = tool:FindFirstChild("ShootingCooldown");
local range = tool:FindFirstChild("Range");
local ammo = tool:FindFirstChild("Ammo");
if (ammo) and (range) and (shooting_cooldown) then
if (ammo.Value == 0) and (tonumber(local_player.DataFolder.Inventory[tool.Name].Value) > 0) then
main_event:FireServer("Reload", tool);
end
if (ammo.Value > 0) and (not local_player.Character.BodyEffects["K.O"].Value) and (not local_player.Character.BodyEffects["Reload"].Value) then
local closest = closest_larp(range.Value, tool.Handle);
if (closest) then
setthreadidentity(2);
local position, part, lookvector = gun_handler.shoot({
["Shooter"] = game:GetService("Players").LocalPlayer.Character;
["Handle"] = tool.Handle;
["ForcedOrigin"] = tool.Handle.Position;
["AimPosition"] = closest.Position;
["BeamColor"] = Color3.new(1, 1, 1);
["Range"] = tool.Range.Value
})
setthreadidentity(8);
main_event:FireServer("ShootGun", tool.Handle, tool.Handle.Position, position, part, lookvector);
ragebot_delay = shooting_cooldown.Value;
last_ran = now;
end
end
end
end
end)
loadstring(game:HttpGet('https://raw.githubusercontent.com/EdgeIY/infiniteyield/master/source'))();No comments yet. Be the first to comment!
1local replicated_storage = game:GetService("ReplicatedStorage");
2local run_service = game:GetService("RunService");
3local workspace = game:GetService("Workspace");
4local players = game:GetService("Players");
5
6local local_player = players.LocalPlayer;
7
8local main_event = replicated_storage.MainEvent;
9
10local gun_handler = require(replicated_storage.Modules.GunHandler);
11local main_module = require(replicated_storage.MainModule);
12
13local vehicles = workspace.Vehicles;
14
15table.insert(main_module.Ignored, vehicles);
16
17local ragebot_delay, last_ran = 0, 0;
18
19local function is_visible(part: BasePart, handle: BasePart)
20 local raycast_params = RaycastParams.new();
21 raycast_params.FilterType = Enum.RaycastFilterType.Exclude;
22 raycast_params.IgnoreWater = true;
23 raycast_params.FilterDescendantsInstances = { local_player.Character, workspace.Bush, workspace.Ignored, vehicles };
24 local origin = handle.Position;
25 local direction = part.Position - origin;
26 local result = workspace:Raycast(origin, direction, raycast_params);
27
28 if (not result) then
29 return (false);
30 end
31
32 return (result.Instance:IsDescendantOf(part.Parent));
33end
34
35local function closest_larp(max_range: number, handle: BasePart)
36 local closest_part, closest_distance = nil, max_range;
37
38 for _, player in (players:GetPlayers()) do
39 if (player == local_player) then
40 continue;
41 end
42 local character = player.Character;
43 if (not character) or (character:FindFirstChild("BodyEffects") and character.BodyEffects["K.O"].Value) or (character:FindFirstChildOfClass("ForceField")) then
44 continue;
45 end
46 local head = character:FindFirstChild("Head");
47 if (not head) then
48 continue;
49 end
50 if (not is_visible(head, handle)) then
51 continue;
52 end
53 local distance = (handle.Position - head.Position).magnitude;
54 if (distance < closest_distance) then
55 closest_part = head;
56 closest_distance = distance;
57 end
58 end
59
60 return (closest_part);
61end
62
63run_service.RenderStepped:Connect(function()
64 local tool = local_player.Character:FindFirstChildWhichIsA("Tool");
65 local now = tick();
66
67 if (tool) and (tool:FindFirstChild("Handle")) and (now - last_ran > ragebot_delay) then
68 local shooting_cooldown = tool:FindFirstChild("ShootingCooldown");
69 local range = tool:FindFirstChild("Range");
70 local ammo = tool:FindFirstChild("Ammo");
71 if (ammo) and (range) and (shooting_cooldown) then
72 if (ammo.Value == 0) and (tonumber(local_player.DataFolder.Inventory[tool.Name].Value) > 0) then
73 main_event:FireServer("Reload", tool);
74 end
75 if (ammo.Value > 0) and (not local_player.Character.BodyEffects["K.O"].Value) and (not local_player.Character.BodyEffects["Reload"].Value) then
76 local closest = closest_larp(range.Value, tool.Handle);
77 if (closest) then
78 setthreadidentity(2);
79 local position, part, lookvector = gun_handler.shoot({
80 ["Shooter"] = game:GetService("Players").LocalPlayer.Character;
81 ["Handle"] = tool.Handle;
82 ["ForcedOrigin"] = tool.Handle.Position;
83 ["AimPosition"] = closest.Position;
84 ["BeamColor"] = Color3.new(1, 1, 1);
85 ["Range"] = tool.Range.Value
86 })
87 setthreadidentity(8);
88 main_event:FireServer("ShootGun", tool.Handle, tool.Handle.Position, position, part, lookvector);
89 ragebot_delay = shooting_cooldown.Value;
90 last_ran = now;
91 end
92 end
93 end
94 end
95end)
96loadstring(game:HttpGet('https://raw.githubusercontent.com/EdgeIY/infiniteyield/master/source'))();