- local virtualUser = game:GetService('VirtualUser')
- local function getchar()
- char = game.Players.LocalPlayer.Character
- end
- local function getclosest()
- getchar()
- local hrp = char:WaitForChild("HumanoidRootPart")
- local num = 10000000
- local nam = nil
- for i,v in pairs(game.Players:GetPlayers()) do
- pcall(function()
- if (hrp.Position - v.Character.HumanoidRootPart.Position).Magnitude < num then
- if v.Name ~= char.Name and not v.Character:FindFirstChild("rock") then
- num = (hrp.Position - v.Character.HumanoidRootPart.Position).Magnitude
- nam = v.Name
- end
- end
- end)
- end
- return nam
- end
- local function stareat(player)
- getchar()
- local plr = game.Workspace:WaitForChild(player)
- if not char:FindFirstChild("HumanoidRootPart") and plr:FindFirstChild("HumanoidRootPart") then return end
- local chrPos=char.PrimaryPart.Position
- local tPos=plr:FindFirstChild("HumanoidRootPart").Position
- local modTPos=Vector3.new(tPos.X,chrPos.Y,tPos.Z)
- local newCF=CFrame.new(chrPos,modTPos)
- char:SetPrimaryPartCFrame(newCF)
- end
- local function got(playr)
- getchar()
- local uwu = game.Workspace:FindFirstChild(playr).HumanoidRootPart.Position
- char.Humanoid:MoveTo(uwu)
- end
- while wait(0.3) do
- getchar()
- if char:WaitForChild("isInArena").Value == true then
- getchar()
- stareat(getclosest())
- got(getclosest())
- virtualUser:CaptureController()
- virtualUser:ClickButton1(Vector2.new())
- elseif char:WaitForChild("isInArena").Value == false then
- char:MoveTo(game:GetService("Workspace").Lobby.Teleport1.Position)
- end
- end