[ad_1]
Created by Wagnarijaz
Features:
- LAZER GUN, SILENT AIM (KILL HUNDREDS OF CHILDREN)
-- made by wag (edited version of in game script)
local between_ray = function(Point_1, Point_2)
local Ray_Params = RaycastParams.new(); Ray_Params.FilterType = Enum.RaycastFilterType.Whitelist
local Parts = {game:GetService("Workspace").Map,game.Workspace.Terrain,game.workspace.Boundaries,game:GetService("Workspace")["Map_Boundaries"],game:GetService("Workspace").Scriptables}
Ray_Params.FilterDescendantsInstances = Parts --Something to keep in mind is that this will filter out descendants of the target part as well
local Ray_Result = nil
local Direction = CFrame.new(Point_1, Point_2).LookVector
local Distance = (Point_1 - Point_2).Magnitude
Ray_Result = workspace:Raycast(Point_1, Direction * Distance,Ray_Params)
if Ray_Result then return true,Ray_Result.Instance end
return false
end
local part_cache = {}
for i,v in ipairs(game.workspace:GetDescendants()) do
if (v.Name == 'Actual_Helment' or v.Parent:FindFirstChild("Humanoid")) or (v:IsA("BasePart") and v.CanCollide == false) then
table.insert(part_cache,v)
end
end
local function closest_player_to_mouse()
local local_player = game.Players.LocalPlayer
local camera = game.workspace.CurrentCamera
local our_team = game.Players.LocalPlayer.Team
local other_team_players = {}
for i,v in ipairs(game.Players:GetPlayers()) do
if v.Team ~= our_team then table.insert(other_team_players,v) end
end
local screen_points = {}
for i,v in ipairs(other_team_players) do
if not v.Character or not v.Character:FindFirstChild("Humanoid") or not v.Character.Humanoid.RootPart then continue end
local position = v.Character.Humanoid.RootPart.Position
local vector,visible = camera:WorldToViewportPoint(position)
if visible then
local check_point = {local_player.Character.Head.Position,v.Character.Head.Position}
local parts_inbetween,part = between_ray(check_point[1],check_point[2],part_cache)
print(parts_inbetween,part)
if parts_inbetween == false then
table.insert(screen_points,{Vector2.new(vector.x,vector.y),player=v})
end
end
end
local mouse_vector = game:GetService("UserInputService"):GetMouseLocation()
local lowest_mag = {player = nil; distance = 1000000;}
for i,v in ipairs(screen_points) do
local mag_distance = (v[1]-mouse_vector).Magnitude
if mag_distance < lowest_mag.distance then
lowest_mag = {player = v.player;distance = mag_distance}
end
end
if not lowest_mag.player then
return false,nil
end
return true,lowest_mag.player
end
local v1 = {};
local framework = require(game:GetService("ReplicatedStorage"):WaitForChild("Modules"):WaitForChild("Universal"):WaitForChild("Framework"));
local modules = framework.modules;
local l__DUC__2 = framework.clientEvents:WaitForChild("DUC");
local run_func = function(p1, p2, p3, p4, p5, p6)
--print("func called",p1,p2,p3,p4,p5,p6)
if p6 == nil then
return;
end;
if p1 ~= nil then
local l__Character__3 = p1.Character;
if p1.Character and p2 ~= nil and p5 ~= nil then
local l__Head__4 = l__Character__3:FindFirstChild("Head");
if p2:IsDescendantOf(l__Character__3) and l__Head__4 then
local v5 = l__Head__4.Position;
if p2.Name == "Stationary MG42" then
v5 = (CFrame.new(l__Head__4.Position) * CFrame.new(0, 0, 5)).p;
end;
local weapon = framework.weapons:FindFirstChild(p2.Name);
local gun_settings = require(weapon:FindFirstChild("Setting"));
if weapon and gun_settings then
if p6 > 250 or gun_settings.AmmoPerClip > 250 then
--return
end;
local gun_handle = p2:FindFirstChild(gun_settings.HandleName);
if gun_handle then
local hit_part, pos_hit, v11 = modules.Raycast(p1, v5, (CFrame.new(l__Head__4.Position, p3) * p4).lookVector, 2000, l__Character__3);
local v12 = ((gun_handle.CFrame * CFrame.new(gun_settings.MuzzleOffset.X, gun_settings.MuzzleOffset.Y, gun_settings.MuzzleOffset.Z)).p - pos_hit).magnitude / 2;
local v13 = nil;
local v14 = false;
local v15 = false;
local v16 = gun_settings.HitSoundIDs[math.random(1, #gun_settings.HitSoundIDs)];
if not hit_part or not hit_part.Parent:FindFirstChild("Humanoid") then
local success,cptm = closest_player_to_mouse()
if success then
hit_part = cptm.Character:FindFirstChildOfClass("MeshPart")
if hit_part then
pos_hit = hit_part.Position
end
end
end
if hit_part and hit_part.Parent then
local hitp_humanoid = hit_part.Parent:FindFirstChild("Humanoid");
local hitp_rootpart = hit_part.Parent:FindFirstChild("HumanoidRootPart");
local hit_head = hit_part.Parent:FindFirstChild("Head")
print("Faking hithead",hit_head)
if hit_head then hit_part = hit_head end
if hitp_humanoid and hitp_humanoid.Health > 0 and hitp_rootpart then
local damage_raw = gun_settings.BaseDamage;
if damage_raw > 105 or gun_settings.BaseDamage > 105 then
return
end;
if hit_part.Name == "Head" then
v14 = true;
damage_raw = gun_settings.BaseDamage * gun_settings.HeadshotDamageMultiplier;
local v20 = gun_settings.HitHeadIDs[math.random(1, #gun_settings.HitHeadIDs)];
else
v20 = gun_settings.HitHumanoidIDs[math.random(1, #gun_settings.HitHumanoidIDs)];
if hit_part.Parent.Name == "Barricade" then
v20 = 142082171;
v15 = true;
end;
end;
local damage = math.ceil(damage_raw);
spawn(function()
modules.Generate_Splash(hit_part.Position, damage, v14, v15, framework.rs.Sounds.HeadSound, framework.rs.Sounds.HitSound, p5);
end);
local v21 = false;
if hitp_humanoid.Parent.Name == "#!D" then
--v21 = true;
--l__DUC__2:Fire();
end;
if v21 then
return;
end;
framework.remote.Attempt_Fire:FireServer(p2, hit_part, hitp_humanoid, hitp_rootpart, pos_hit, v13, damage, p6, gun_settings.AmmoPerClip, gun_settings.FireRate, v21);
else
local v22 = Vector3.new(0, 1, 0):Cross(v11);
v13 = { pos_hit, v22, math.asin(v22.magnitude) };
end;
if hit_part.Name == "Actual_Helmet" then
v13 = nil;
local l__Humanoid__23 = hit_part.Parent.Parent:FindFirstChild("Humanoid");
if l__Humanoid__23 then
local v24 = framework.players:GetPlayerFromCharacter(l__Humanoid__23.Parent);
if v24 == nil or v24.Team ~= p1.Team then
v16 = gun_settings.HelmetSoundID;
spawn(function()
modules.Generate_Splash(hit_part.Position, 0, false, false, framework.rs.Sounds.HeadSound, framework.rs.Sounds.HelmetSound, p5);
end);
framework.remote.Attempt_Fire:FireServer(p2, hit_part, hitp_humanoid, hitp_rootpart, pos_hit, v13, 0, p6, gun_settings.AmmoPerClip, gun_settings.FireRate);
end;
end;
end;
end;
framework.clientEvents.Visualize_Bullet:Fire(gun_handle, gun_settings, hit_part, pos_hit, v16, v13);
framework.remote.Display_Bullet:FireServer(p2, hit_part, pos_hit, v13, gun_settings.FireRate);
end;
end;
end;
end;
end;
end;
local cb = game:GetService("ReplicatedStorage").Modules.Client["Client_Bullet"]
require(game:GetService("ReplicatedStorage").Modules.Universal.Framework).modules.Client_Bullet = run_func
local sc
for i,v in ipairs(game.Players.LocalPlayer.Backpack:GetDescendants()) do
if v.Name == 'GunScript_Local' then sc = v end
end
local fire_func = getsenv(sc).Fire
local m = (getupvalue(fire_func,3))
m.Client_Bullet = run_func
setupvalue(fire_func,3,m)
ENJOY!
Warning: DO NOT DOWNLOAD anything from this page, you’re only here to copy the script!
[ad_2]