Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Settings
- local range = -5 -- Adjust this for each game (e.g., -3 for close-range games, -5/-4 for sword)
- -- Variables
- local localplayer = game.Players.LocalPlayer
- local localcharacter = localplayer.Character or localplayer.CharacterAdded:Wait()
- local localroot = localcharacter:WaitForChild("HumanoidRootPart")
- local localhumanoid = localcharacter:WaitForChild("Humanoid")
- -- Load Orion Library and create GUI
- local OrionLib = loadstring(game:HttpGet('https://raw.githubusercontent.com/shlexware/Orion/main/source'))()
- local Window = OrionLib:MakeWindow({
- Name = "FE Kill All Script GUI v3",
- HidePremium = false,
- SaveConfig = true,
- ConfigFolder = "OrionTest"
- })
- -- Create tabs and sections
- local Tab = Window:MakeTab({
- Name = "Main",
- Icon = "rbxassetid://4483345998",
- PremiumOnly = false
- })
- local Section = Tab:AddSection({
- Name = "Section Script"
- })
- -- State Variable
- local FEKillAllToggle = false
- -- Function to get the root part of a character model (HumanoidRootPart, UpperTorso, or Torso)
- local function getCharacterRootPart(character)
- return character:FindFirstChild("HumanoidRootPart") or
- character:FindFirstChild("UpperTorso") or
- character:FindFirstChild("Torso")
- end
- -- Function to update local character references
- local function updateLocalCharacter()
- localcharacter = localplayer.Character or localplayer.CharacterAdded:Wait()
- localroot = getCharacterRootPart(localcharacter)
- localhumanoid = localcharacter:WaitForChild("Humanoid")
- end
- -- Update character references on respawn
- localplayer.CharacterAdded:Connect(function()
- updateLocalCharacter()
- FEKillAllToggle = false
- end)
- -- Function to move target to range and set speed to 0
- local function bringTargetToRange(target)
- local targetRoot = getCharacterRootPart(target)
- local targetHumanoid = target:FindFirstChild("Humanoid")
- if targetRoot and targetHumanoid and localhumanoid.Health > 0 and targetHumanoid.Health > 0 then
- targetRoot.CFrame = localroot.CFrame * CFrame.new(0, 0, range)
- targetHumanoid.WalkSpeed = 0
- end
- end
- -- Function to get all potential targets (players and NPCs)
- local function getAllTargets()
- local targets = {}
- -- Add NPCs (any model with Humanoid in the workspace)
- for _, model in pairs(workspace:GetDescendants()) do
- if model:IsA("Model") and model:FindFirstChild("Humanoid") and getCharacterRootPart(model) then
- -- Check to exclude the local player's character
- if model ~= localplayer.Character then
- table.insert(targets, model)
- end
- end
- end
- return targets
- end
- -- Add "FE Kill All" toggle
- Tab:AddToggle({
- Name = "FE Kill All Toggle",
- Default = false,
- Callback = function(state)
- FEKillAllToggle = state
- if FEKillAllToggle then
- coroutine.wrap(function()
- while FEKillAllToggle do
- for _, target in ipairs(getAllTargets()) do
- bringTargetToRange(target)
- end
- game:GetService("RunService").RenderStepped:Wait()
- end
- end)()
- end
- end
- })
Advertisement
Add Comment
Please, Sign In to add comment