
KeylessUniversal

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 e = Instance.new("ScreenGui")
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(0, 0, 0)
f.TextColor3 = Color3.fromRGB(70, 30, 10)
f.Font = Enum.Font.SourceSansBold
f.TextSize = 20
f.Text = "Grab"
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 and t < 10 then
q = t
p = r
end
end
end
end
return p
end
-- Grab function
local function u()
local v = m()
if v and v.Character then
local w = v.Character:FindFirstChild("Head")
if w then
local x = {
[1] = w,
[2] = "Grab"
}
d:FireServer(unpack(x))
end
end
end
f.MouseButton1Click:Connect(u)No comments yet for this script.



