Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- boxHandle = function(part, color)
- if part.ClassName == "Part" or part.ClassName == "MeshPart" then
- local cham = Instance.new("BoxHandleAdornment")
- cham.Parent = part
- cham.Adornee = part
- cham.ZIndex = 2
- cham.AlwaysOnTop = true
- cham.Size = part.Size
- if #game:GetService("Teams"):GetTeams() > 0 then
- cham.Color3 = color
- else
- cham.Color3 = Color3.new(255, 0, 0)
- end
- end
- end
- createChams = function(player)
- pcall(function()
- if player.Character and player.Character.HumanoidRootPart and not (player.Name == game:GetService("Players").LocalPlayer.Name) then
- for _,v in pairs(player.Character:GetChildren()) do
- if v.ClassName == "Part" or v.ClassName == "MeshPart" then
- if player.Character:WaitForChild(v.Name):FindFirstChild("BoxHandleAdornment") then
- player.Character:WaitForChild(v.Name):FindFirstChild("BoxHandleAdornment"):Destroy()
- end
- boxHandle(v, player.TeamColor.Color)
- end
- end
- boxHandle(player, player.TeamColor.Color)
- print("created " .. player.Name)
- end
- end)
- end
- while wait(1) do
- for _,v in pairs(game:GetService("Players"):GetPlayers()) do
- createChams(v)
- end
- end
- game:GetService("Players").PlayerAdded:connect(function(player)
- wait()
- createChams(player)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement