-- SOOO SEXYYY UGH
local plrs = game:GetService("Players")
local rs = game:GetService("RunService")
local cg = game:GetService("CoreGui")
repeat task.wait() until game:IsLoaded()
local lp = plrs.LocalPlayer
local container = (gethui and gethui()) or cg
local cfg = {
white_col = Color3.fromRGB(255, 255, 255),
black_col = Color3.fromRGB(0, 0, 0),
t_check = false,
size = Vector3.new(4, 5, 2)
}
local function draw(p)
local id = "v3_heavy_" .. p.UserId
local g = container:FindFirstChild(id) or Instance.new("Folder")
g.Name = id
g.Parent = container
local edges = {
{"f1", "f2"}, {"f2", "f3"}, {"f3", "f4"}, {"f4", "f1"},
{"b1", "b2"}, {"b2", "b3"}, {"b3", "b4"}, {"b4", "b1"},
{"f1", "b1"}, {"f2", "b2"}, {"f3", "b3"}, {"f4", "b4"}
}
local cache = {}
for _, pair in next, edges do
local name = pair[1] .. pair[2]
local out = g:FindFirstChild(name .. "_o") or Instance.new("LineHandleAdornment")
out.Name = name .. "_o"
out.Thickness = 2.4
out.Transparency = 0
out.AlwaysOnTop = true
out.ZIndex = 1
out.Color3 = cfg.black_col
out.Adornee = workspace:FindFirstChildOfClass("Terrain")
out.Parent = g
local main = g:FindFirstChild(name .. "_m") or Instance.new("LineHandleAdornment")
main.Name = name .. "_m"
main.Thickness = 1.8
main.Transparency = 0
main.AlwaysOnTop = true
main.ZIndex = 2
main.Color3 = cfg.white_col
main.Adornee = workspace:FindFirstChildOfClass("Terrain")
main.Parent = g
cache[name] = {m = main, o = out}
end
local function step()
local char = p.Character
local root = char and char:FindFirstChild("HumanoidRootPart")
if root and (not cfg.t_check or p.Team ~= lp.Team) then
local cf = root.CFrame
local s = cfg.size / 2
local pts = {
f1 = (cf * CFrame.new(-s.X, s.Y, s.Z)).p,
f2 = (cf * CFrame.new( s.X, s.Y, s.Z)).p,
f3 = (cf * CFrame.new( s.X, -s.Y, s.Z)).p,
f4 = (cf * CFrame.new(-s.X, -s.Y, s.Z)).p,
b1 = (cf * CFrame.new(-s.X, s.Y, -s.Z)).p,
b2 = (cf * CFrame.new( s.X, s.Y, -s.Z)).p,
b3 = (cf * CFrame.new( s.X, -s.Y, -s.Z)).p,
b4 = (cf * CFrame.new(-s.X, -s.Y, -s.Z)).p
}
for _, pair in next, edges do
local c = cache[pair[1] .. pair[2]]
local p1, p2 = pts[pair[1]], pts[pair[2]]
local look = CFrame.new(p1, p2)
local mag = (p1 - p2).Magnitude
c.m.CFrame, c.o.CFrame = look, look
c.m.Length, c.o.Length = mag, mag
c.m.Visible, c.o.Visible = true, true
end
else
for _, c in next, cache do
c.m.Visible, c.o.Visible = false, false
end
end
end
rs.RenderStepped:Connect(step)
end
for _, v in next, plrs:GetPlayers() do
if v ~= lp then draw(v) end
end
plrs.PlayerAdded:Connect(function(v)
if v ~= lp then draw(v) end
end)
plrs.PlayerRemoving:Connect(function(v)
local g = container:FindFirstChild("v3_heavy_" .. v.UserId)
if g then g:Destroy() end
end)
Comments
No comments yet
Be the first to share your thoughts!