Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- /$$$$$$ /$$$$$$$$ /$$$$$$ /$$$$$$$ /$$
- /$$__ $$ | $$_____/ /$$__ $$| $$__ $$ /$$$$
- | $$ \__/ /$$$$$$$ /$$$$$$ /$$$$$$ | $$ | $$ \__/| $$ \ $$ /$$ /$$|_ $$
- | $$$$$$ /$$_____/ |____ $$ /$$__ $$| $$$$$ | $$$$$$ | $$$$$$$/ | $$ /$$/ | $$
- \____ $$| $$ /$$$$$$$| $$ \ $$| $$__/ \____ $$| $$____/ \ $$/$$/ | $$
- /$$ \ $$| $$ /$$__ $$| $$ | $$| $$ /$$ \ $$| $$ \ $$$/ | $$
- | $$$$$$/| $$$$$$$| $$$$$$$| $$$$$$$/| $$$$$$$$| $$$$$$/| $$ \ $/ /$$$$$$
- \______/ \_______/ \_______/| $$____/ |________/ \______/ |__/ \_/ |______/
- | $$
- | $$
- |__/
- ]]--
- --Update Speed--
- _G.speed = 2 --Raise this if you're lagging(execute _G.speed = [desired speed])
- --Update Speed--
- --Do Not Edit Anything!!!--
- --Variables--
- local plrs = game:GetService("Players")
- local wrk = game:GetService("Workspace")
- local lp = plrs.LocalPlayer
- local camera = wrk.CurrentCamera
- local debounce = 0
- --Variables--
- --Instances--
- local chams = Instance.new("Folder")
- chams.Name = "Chams"
- chams.Parent = game:GetService("CoreGui")
- --Instances--
- --Functions--
- function checkWalls(limb, plr)
- if plrs:FindFirstChild(plr.Name) then
- if plr.Character and plr.Character.HumanoidRootPart and lp.Character and lp.Character.HumanoidRootPart then
- local hit = workspace:FindPartOnRayWithIgnoreList(Ray.new(lp.Character.HumanoidRootPart.CFrame.p, (limb.CFrame.p-lp.Character.HumanoidRootPart.CFrame.p).unit*500), {camera, lp.Character, chams}, false, true)
- if hit:IsDescendantOf(plr.Character) then
- return true
- end
- return false
- end
- end
- end
- function setColor(v, limb)
- if v.TeamColor == lp.TeamColor and checkWalls(limb, v) then --Friendly and Visible(Green)
- return Color3.fromRGB(0, 255, 0)
- elseif v.TeamColor == lp.TeamColor and not checkWalls(limb, v) then --Friendly and Not Visible(Yellow)
- return Color3.fromRGB(255, 255, 0)
- elseif v.TeamColor ~= lp.TeamColor and checkWalls(limb, v) then --Enemy and Visible(Red)
- return Color3.fromRGB(255, 0, 0)
- elseif v.TeamColor ~= lp.TeamColor and not checkWalls(limb,v) then --Enemy and Not Visible(Orange)
- return Color3.fromRGB(255, 170, 0)
- end
- end
- function createCham(limb, plr, fold)
- local cham = Instance.new("BoxHandleAdornment")
- cham.Name = "Cham"
- cham.Color3 = setColor(plr, limb)
- cham.Adornee = limb
- cham.Size = limb.Size+Vector3.new(0.01, 0.01, 0.01)
- cham.AlwaysOnTop = true
- cham.ZIndex = 1
- cham.Parent = fold
- end
- function newCham(v)
- if chams:FindFirstChild(v.Name) then
- chams[v.Name]:Destroy()
- end
- local char = Instance.new("Folder")
- char.Name = v.Name
- char.Parent = chams
- if v.Character then
- for _,c in pairs(v.Character:GetChildren()) do
- if c:IsA("BasePart") then
- createCham(c, v, char)
- end
- end
- end
- end
- --Functions--
- --Framework--
- plrs.PlayerRemoving:connect(function(plr)
- if chams:FindFirstChild(plr.Name) then
- chams[plr.Name]:Destroy()
- end
- end)
- plrs.PlayerAdded:connect(function(v)
- spawn(function()
- repeat wait() until v.Character
- if v.Character then
- newCham(v)
- end
- v.CharacterAdded:connect(function(char)
- repeat wait() until char.HumanoidRootPart
- newCham(v)
- end)
- end)
- end)
- for _,v in pairs(plrs:GetChildren()) do
- if v ~= lp then
- spawn(function()
- repeat wait() until v.Character
- if v.Character then
- newCham(v)
- end
- v.CharacterAdded:connect(function(char)
- repeat wait() until char.HumanoidRootPart
- newCham(v)
- end)
- end)
- end
- end
- game:GetService("RunService").RenderStepped:connect(function()
- if debounce%_G.speed == 0 then
- for _,v in pairs(chams:GetChildren()) do
- for _,c in pairs(v:GetChildren()) do
- c.Color3 = setColor(plrs[v.Name], c.Adornee)
- end
- end
- end
- debounce = debounce+1
- end)
- --Framework--
- --Do Not Edit Anything!!!--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement