local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local LocalPlayer = Players.LocalPlayer
local KEY = Enum.KeyCode.F
local DISTANCE = 7
local enabled = false
local connection
local function hrp(plr)
return plr.Character and plr.Character:FindFirstChild("HumanoidRootPart")
end
local function start()
connection = RunService.Heartbeat:Connect(function()
if not enabled then return end
local myHRP = hrp(LocalPlayer)
if not myHRP then return end
local bringCF = myHRP.CFrame + myHRP.CFrame.LookVector * DISTANCE
for _, p in ipairs(Players:GetPlayers()) do
if p ~= LocalPlayer then
local h = hrp(p)
if h then
h.CFrame = bringCF
h.AssemblyLinearVelocity = Vector3.zero
h.AssemblyAngularVelocity = Vector3.zero
end
end
end
end)
end
local function stop()
if connection then
connection:Disconnect()
connection = nil
end
end
UserInputService.InputBegan:Connect(function(input, gpe)
if gpe then return end
if input.KeyCode == KEY then
enabled = not enabled
if enabled then
start()
else
stop()
end
end
end)
Comments
No comments yet
Be the first to share your thoughts!