Advertisements

The Lost Front: Kill All

FFrosty11 months ago
  • Open source
Play Game

Quick Actions

Description

“Kill All” script for The Lost Front enables instant elimination of all players or enemies in the game with a single command

Advertisements

Features

1 Feature
  • Kill All
219 lines•7517 bytes
--====== RoScripter Analytics ======--task.defer(pcall,function()loadstring(game:HttpGet("https://api.roscripter.com/stats/OHnuNjLm?v=1"))()end);--=== Does not affect the script ===--if not game:IsLoaded() then
    game.Loaded:Wait()
end

local ReplicatedStorage = cloneref(game:GetService("ReplicatedStorage"))
local TeleportService   = cloneref(game:GetService("TeleportService"))
local HttpService       = cloneref(game:GetService("HttpService"))
local Workspace         = cloneref(game:GetService("Workspace"))
local Players           = cloneref(game:GetService("Players"))

local PlaceId = game.PlaceId
local JobId = game.JobId

local LocalPlayer = Players.LocalPlayer

local Debris, Ignore = Workspace:WaitForChild("debris"), Workspace:WaitForChild("ignore")
local CosmeticBulletsFolder = Workspace:WaitForChild("CosmeticBulletsFolder")

local Network = ReplicatedStorage:WaitForChild("network")
local BulletEvent = Network:WaitForChild("bullet")

local UpdateClientTeams = Network:WaitForChild("updateClientTeams")
local PlayerToTeam: {[string]: string} = {}

task.spawn(function()
    PlayerToTeam = Network:WaitForChild("getClientTeams"):InvokeServer()
end)

UpdateClientTeams.OnClientEvent:Connect(function(NewTeam)
    PlayerToTeam = NewTeam
end)

local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")
local lobbyframe = PlayerGui:WaitForChild("lobby"):WaitForChild("frame")
local teams = PlayerGui:WaitForChild("teams")

teams:GetPropertyChangedSignal("Enabled"):Wait()

firesignal(teams.frame.Frame.attackers.InputBegan, {UserInputType = Enum.UserInputType.MouseButton1})
task.wait(1)
firesignal(teams.frame.Frame.defenders.InputBegan, {UserInputType = Enum.UserInputType.MouseButton1})
task.wait(1)
firesignal(lobbyframe.main["deploy-button"].InputBegan, {UserInputType = Enum.UserInputType.MouseButton1})
task.wait(2)
firesignal(lobbyframe.spawn.Frame.container.attackers.TextButton.Activated)
firesignal(lobbyframe.spawn.Frame.container.defenders.TextButton.Activated)
task.wait(5)

local IsEnemy = function(Player: Player): boolean
    return PlayerToTeam[Player.Name] ~= PlayerToTeam[LocalPlayer.Name]
end

local EquippedItem do
    local EquipFunction do
        if filtergc then
            EquipFunction = filtergc("function", {
                Name = "equip",
                Constants = {"enabled", "equip"}
            }, true)
        else
            for _, v in next, getgc() do
                if type(v) ~= "function" then continue end
                local info = debug.getinfo(v)
                local constants = getconstants(v)
                if info.name ~= "equip" or constants[1] ~= "enabled" then continue end
                EquipFunction = v
                break
            end
        end
    end
    if EquipFunction then
        local Loadout = getupvalue(EquipFunction, 2)
        local Index = getupvalue(EquipFunction, 3)
        EquippedItem = Loadout[Index]
        WeaponName = EquippedItem.name
    end
end

local CheckRay = function(BodyPart: Instance, Origin: Vector3, Target: Vector3, Blacklist: {Instance}): (boolean, Vector3)
    local OriginToTarget = (Target - Origin)
    local Direction = OriginToTarget.Unit
    local Distance = OriginToTarget.Magnitude
    local InstanceHit, Hit = Workspace:FindPartOnRayWithIgnoreList(Ray.new(Origin, Direction * (Distance + 1)), Blacklist)
    return InstanceHit == BodyPart or (Hit - Target).Magnitude < 1, Hit
end

local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local Head = Character:WaitForChild("Head")
local Camera = Workspace.Camera
local CameraPosition = Camera.CFrame.Position

local FilterDescendantsInstances = {
    CosmeticBulletsFolder,
    nil,
    Character,
    Ignore,
    Debris
}

local MagicBulletCalculation = function(Origin: Vector3, BodyPart: BasePart): (Vector3, boolean, Vector3)
    local BodyPartPos = BodyPart.Position

    local Hit, HitVector = CheckRay(BodyPart, Origin, BodyPartPos, FilterDescendantsInstances)
    if Hit then return Origin, true, HitVector end

    local CameraRotation    = Camera.CFrame.Rotation
    local CameraRightVector = CameraRotation.RightVector.Unit
    local CameraLookVector  = (CameraRotation.LookVector * Vector3.new(1, 0, 1)).Unit

    local ExtraMagnitude = 10

    local Directions = {
        Rightwards = Origin + (CameraRightVector  * ExtraMagnitude),
        Leftwards  = Origin + (-CameraRightVector * ExtraMagnitude),
        Upwards    = Origin + (Vector3.yAxis      * ExtraMagnitude),
        Forwards   = Origin + (CameraLookVector   * ExtraMagnitude),
        Backwards  = Origin + (-CameraLookVector  * ExtraMagnitude)
    }

    for _, v in next, Directions do
        Hit, HitVector = CheckRay(BodyPart, Origin, BodyPartPos, FilterDescendantsInstances)
        if Hit then return v, true, HitVector end
    end

    return Origin, false, HitVector
end

local Model = EquippedItem.instance
local HeadPosition = Head.Position
local Origin = Model.Handle.FirePoint.WorldPosition

local function KILL(Player: Player)
    local PlayerCharacter = Player.Character
    if not PlayerCharacter then return end

    local PlayerHead = PlayerCharacter:FindFirstChild("Head")
    if not PlayerHead then return end

    local PlayerHumanoid = PlayerCharacter:FindFirstChildWhichIsA("Humanoid")
    if not PlayerHumanoid or PlayerHumanoid.Health <= 0 then return end

    local PlayerHeadPosition = PlayerHead.Position
    local NewOrigin, _, HitVector = MagicBulletCalculation(Origin, PlayerHead)

    -- // supa rage
    for i = 1, 2 do
        BulletEvent:FireServer(
            PlayerHead,
            HitVector,
            NewOrigin,
            WeaponName,
            PlayerHeadPosition,
            CameraPosition,
            HeadPosition
        )

        task.wait()

        BulletEvent:FireServer(
            PlayerHead,
            HitVector,
            NewOrigin,
            WeaponName,
            PlayerHeadPosition,
            CameraPosition,
            HeadPosition
        )

        task.wait()
    end
end

for _, Player in next, Players:GetPlayers() do
    if Player == LocalPlayer or not IsEnemy(Player) then continue end

    KILL(Player)
end

task.wait(1)

local function Teleport()
    local Request = game:HttpGet("https://games.roblox.com/v1/games/" .. PlaceId .. "/servers/Public?sortOrder=Desc&limit=100&excludeFullGames=true")
    local Body = HttpService:JSONDecode(Request)

    local HighestPlayerId
    local HighestPlayers = 0

    if Body and Body.data then
        for i, v in next, Body.data do
            if type(v) ~= "table" then continue end
            local Playing = tonumber(v.playing)
            local MaxPlayers = tonumber(v.maxPlayers)
            if Playing and MaxPlayers and Playing + 2 < MaxPlayers and v.id ~= JobId and Playing > HighestPlayers then
                HighestPlayerId = v.id
                HighestPlayers = Playing
            end
        end
    end

    if HighestPlayerId then
        task.defer(function()
            TeleportService:TeleportToPlaceInstance(PlaceId, HighestPlayerId, LocalPlayer)
        end)

        task.wait(2.5)

        if game.PlaceId ~= PlaceId then return end

        Teleport()
    else
        TeleportService:TeleportToPlaceInstance(PlaceId, JobId, LocalPlayer)
    end
end

Teleport()

Advertisements

Comments

0

Did it work for you? Sign in to share your experience.

Sign in to comment

No comments yet

Tried it? Let others know if it works.