Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pcall(function()
- game:GetService("Workspace"):FindFirstChild("Map").Parent = game:GetService("Workspace").IgnoreThese
- game:GetService("Workspace"):FindFirstChild("BuildStuff").Parent = game:GetService("Workspace").IgnoreThese
- end)
- local map = game:GetService("Workspace").IgnoreThese.Map
- local bStuff = game:GetService("Workspace").IgnoreThese.BuildStuff
- local localPlayer = game:GetService("Players").LocalPlayer
- local mouse = localPlayer:GetMouse()
- local teamCheck = true
- local function getClosestPlayer()
- local closestPlayer = nil
- local shortestDistance = math.huge
- for i, v in pairs(game:GetService("Players"):GetPlayers()) do
- if v.Name ~= localPlayer.Name then
- if v.Character and v.Character:FindFirstChild("Humanoid") and v.Character.Humanoid.Health ~= 0 and v.Character:FindFirstChild("HumanoidRootPart") and v.Character:FindFirstChild("Head") and teamCheck and v.Team ~= localPlayer.Team then
- local magnitude = (v.Character.HumanoidRootPart.Position - localPlayer.Character.HumanoidRootPart.Position).magnitude
- if magnitude < shortestDistance then
- closestPlayer = v
- shortestDistance = magnitude
- end
- elseif v.Character and v.Character:FindFirstChild("Humanoid") and v.Character.Humanoid.Health ~= 0 and v.Character:FindFirstChild("HumanoidRootPart") and v.Character:FindFirstChild("Head") and not teamCheck then
- local magnitude = (v.Character.HumanoidRootPart.Position - localPlayer.Character.HumanoidRootPart.Position).magnitude
- if magnitude < shortestDistance then
- closestPlayer = v
- shortestDistance = magnitude
- end
- end
- end
- end
- return closestPlayer or localPlayer
- end
- game:GetService("UserInputService").InputBegan:Connect(function(input, onGui)
- if onGui then return end
- if input.KeyCode == Enum.KeyCode.T then
- teamCheck = not teamCheck
- end
- end)
- local mt = getrawmetatable(game)
- local oldIndex = mt.__index
- setreadonly(mt, false)
- mt.__index = newcclosure(function(t, k)
- if tostring(k) == "Map" then
- return map
- end
- if tostring(k) == "BuildStuff" then
- return bStuff
- end
- if t == mouse and tostring(k) == "Hit" then
- return getClosestPlayer().Character.Head.CFrame
- end
- return oldIndex(t, k)
- end)
- setreadonly(mt, true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement