
Keyless

local a = game:GetService("Players")
local b = game:GetService("ReplicatedStorage")
local c = a.LocalPlayer
local d = b:WaitForChild("Events"):WaitForChild("Grab")
local RunService = game:GetService("RunService")
local h = c:WaitForChild("PlayerGui"):FindFirstChild("Mchaezter_grab_gui")
if h then h:Destroy() end
local e = Instance.new("ScreenGui")
e.Name = "Mchaezter_grab_gui"
e.ResetOnSpawn = false
e.Parent = c:WaitForChild("PlayerGui")
-- Grab Button
local f = Instance.new("TextButton")
f.Draggable = true
f.Size = UDim2.new(0, 50, 0, 50)
f.Position = UDim2.new(0.9, -70, 0.2, -25)
f.BackgroundColor3 = Color3.fromRGB(30, 0, 70)
f.TextColor3 = Color3.fromRGB(255, 255, 255)
f.Font = Enum.Font.SourceSansBold
f.TextSize = 10
f.Text = "Grab Nearest"
f.Parent = e
-- Nearest player check
local function m()
local n = c.Character
if not n then return end
local o = n:FindFirstChild("HumanoidRootPart")
if not o then return end
local p = nil
local q = math.huge
for _, r in pairs(a:GetPlayers()) do
if r ~= c and r.Character then
local s = r.Character:FindFirstChild("HumanoidRootPart")
if s then
local t = (o.Position - s.Position).Magnitude
if t < q then
q = t
p = r
end
end
end
end
return p
end
-- Grab function
local function u(targetPlayer)
if targetPlayer and targetPlayer.Character then
local head = targetPlayer.Character:FindFirstChild("Head")
if head then
d:FireServer(head, "Grab")
end
end
end
f.MouseButton1Click:Connect(function()
task.spawn(function()
pcall(function()
local hu = c.Character:WaitForChild("HumanoidRootPart")
local sav = hu.CFrame
local targetPlayer = m()
if not targetPlayer or not targetPlayer.Character then return end
local tar = targetPlayer.Character:FindFirstChild("HumanoidRootPart")
if not tar then return end
hu.CFrame = tar.CFrame
task.wait(0.15)
task.spawn(function()
u(targetPlayer)
hu.CFrame = tar.CFrame
end)
hu.CFrame = sav
end)
end)
end)No comments yet for this script.