
Key RequiredUniversal

-- LocalScript (StarterPlayerScripts)
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local LocalPlayer = Players.LocalPlayer
local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")
-- UI Setup
local screenGui = Instance.new("ScreenGui", PlayerGui)
screenGui.Name = "CommandGUI"
screenGui.ResetOnSpawn = false
local textBox = Instance.new("TextBox")
textBox.Size = UDim2.new(0, 250, 0, 40)
textBox.Position = UDim2.new(0.5, -125, 0.05, 0)
textBox.PlaceholderText = "Type: grab/kill/kil/to"
textBox.TextScaled = true
textBox.ClearTextOnFocus = true
textBox.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
textBox.TextColor3 = Color3.new(1, 1, 1)
textBox.Parent = screenGui
local button = Instance.new("TextButton")
button.Size = UDim2.new(0, 100, 0, 40)
button.Position = UDim2.new(0.5, 130, 0.05, 0)
button.Text = "Submit"
button.TextScaled = true
button.BackgroundColor3 = Color3.fromRGB(60, 100, 60)
button.TextColor3 = Color3.new(1, 1, 1)
button.Parent = screenGui
local loopBtn = Instance.new("TextButton")
loopBtn.Size = UDim2.new(0, 100, 0, 40)
loopBtn.Position = UDim2.new(0.5, -230, 0.05, 0)
loopBtn.Text = "Loop: OFF"
loopBtn.TextScaled = true
loopBtn.BackgroundColor3 = Color3.fromRGB(100, 60, 60)
loopBtn.TextColor3 = Color3.new(1, 1, 1)
loopBtn.Parent = screenGui
-- Command State
local currentCommand = nil
local currentTargetName = nil
local isLooping = false
local function waitForCharacter()
while not LocalPlayer.Character or not LocalPlayer.Character:FindFirstChild("HumanoidRootPart") do
LocalPlayer.CharacterAdded:Wait()
end
return LocalPlayer.Character
end
local function getPlayerByPartialName(partial)
partial = partial:lower()
for _, plr in ipairs(Players:GetPlayers()) do
if plr ~= LocalPlayer and plr.Name:lower():sub(1, #partial) == partial then
return plr
end
end
end
local function executeAction(targetPlayer, isGrab)
local myChar = waitForCharacter()
if not targetPlayer or not targetPlayer.Character or not myChar then return end
local targetChar = targetPlayer.Character
if not myChar:FindFirstChild("HumanoidRootPart") or not targetChar:FindFirstChild("HumanoidRootPart") then return end
local originalCFrame = myChar.HumanoidRootPart.CFrame
local oldHumanoid = myChar:FindFirstChildOfClass("Humanoid")
if oldHumanoid then oldHumanoid:Destroy() end
Instance.new("Humanoid").Parent = myChar
for _, v in ipairs(targetChar:GetChildren()) do
if v:IsA("Accessory") then v:Destroy() end
end
local backpack = LocalPlayer:FindFirstChild("Backpack")
if backpack then
local tools = {}
for _, tool in ipairs(backpack:GetChildren()) do
if tool:IsA("Tool") then table.insert(tools, tool) end
end
if #tools > 0 then
local randomTool = tools[math.random(1, #tools)]
randomTool.Parent = myChar
end
end
myChar:SetPrimaryPartCFrame(targetChar.HumanoidRootPart.CFrame)
task.wait(1)
if isGrab then
myChar:SetPrimaryPartCFrame(originalCFrame)
else
myChar:SetPrimaryPartCFrame(CFrame.new(9999999999, 9999999999, 9999999999))
end
end
local function runCommand()
if not currentCommand then return end
local target = getPlayerByPartialName(currentTargetName)
if currentCommand == "grab" then
executeAction(target, true)
elseif currentCommand == "kill" then
executeAction(target, false)
elseif currentCommand == "kil" then
if target and target.Character and target.Character:FindFirstChild("Humanoid") then
target.Character.Humanoid.Health = 0
end
elseif currentCommand == "to" then
local myChar = waitForCharacter()
if target and target.Character and target.Character:FindFirstChild("HumanoidRootPart") and myChar:FindFirstChild("HumanoidRootPart") then
myChar:PivotTo(target.Character.HumanoidRootPart.CFrame + Vector3.new(0, 3, 0))
end
end
end
-- Submit Button Click
button.MouseButton1Click:Connect(function()
local text = textBox.Text:lower()
local cmd, name = text:match("^(%w+)%s*(%S*)$")
if not cmd then return end
if cmd ~= "grab" and cmd ~= "kill" and cmd ~= "kil" and cmd ~= "to" then return end
currentCommand = cmd
currentTargetName = name ~= "" and name or nil
runCommand()
textBox.Text = ""
end)
-- Loop Toggle
loopBtn.MouseButton1Click:Connect(function()
isLooping = not isLooping
loopBtn.Text = "Loop: " .. (isLooping and "ON" or "OFF")
loopBtn.BackgroundColor3 = isLooping and Color3.fromRGB(60, 120, 60) or Color3.fromRGB(100, 60, 60)
end)
-- Loop every frame
RunService.Heartbeat:Connect(function()
if isLooping and currentCommand and currentTargetName then
runCommand()
end
end)
-- Handle Respawn
LocalPlayer.CharacterAdded:Connect(function()
waitForCharacter()
end)
-- Handle Target Rejoin
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function()
if isLooping then
task.wait(3)
runCommand()
end
end)
end)



That script by ChatGpt lol
i agree
the correct description is "this was the hardest script that ChatGPT ever made lol so im publishing it"
Visual or not?
how the hell does this even work