Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService'Players'
- local Player = Players.LocalPlayer
- local ShowInvisibleParts = true;
- function TrackHum(v, vHRP)
- local InvisibruParts = {}
- repeat wait(.4) until #vHRP.Parent:GetChildren() > 4
- for ii,vv in pairs(vHRP.Parent:GetChildren()) do
- if vv:IsA'BasePart' then
- local Box = Instance.new('BoxHandleAdornment', workspace)
- Box.Adornee = vv
- Box.Size = vv:GetMass() > 1 and vv.Size-Vector3.new(.1,.1,.1) or Vector3.new(.4,.4,.4)
- Box.Transparency = (vv.Transparency < 1 or ShowInvisibleParts) and .5 or 1
- Box.AlwaysOnTop = true
- Box.ZIndex = 1
- Box.Color3 = Color3.new(242, 243, 243)
- InvisibruParts[#InvisibruParts+1] = Box
- local OnChange = not ShowInvisibleParts and vv.Changed:connect(function(Prop)
- if Prop == 'Transparency' then
- Box.Transparency = vv.Transparency < 1 and .5 or 1
- Box.Transparency = Color3.new(242, 243, 243)
- end
- end)
- local VChange = v.Changed:connect(function(Prop)
- if Prop == 'TeamColor' then
- Box.Color3 = Color3.new(242, 243, 243)
- end
- end)
- local PlayerChange = Player.Changed:connect(function(Prop)
- if Prop == 'TeamColor' then
- Box.Color3 = Color3.new(242, 243, 243)
- end
- end)
- local OnRemove; OnRemove = Player.CharacterRemoving:connect(function()
- Box:Destroy()
- VChange:disconnect()
- if not ShowInvisibleParts then
- OnChange:disconnect()
- end;
- PlayerChange:disconnect()
- OnRemove:disconnect()
- end)
- end
- end
- end
- function Track(v)
- warn(v.Name..' is being tracked', v and v.Character and #v.Character:GetChildren())
- local vHum = v and v.Character and v.Character:FindFirstChild'Humanoid'
- local vHRP = vHum and vHum.Parent:FindFirstChild'HumanoidRootPart'
- if vHRP and vHum.Health > 0 then
- local Head = v.Character:WaitForChild('Head', 10)
- if Head then
- TrackHum(v, vHRP)
- else
- warn('Head not found in Player: '..v.Name)
- end
- end
- local OnAdded = v.CharacterAdded:connect(function(char)
- local vHRP2 = char:WaitForChild'HumanoidRootPart'
- local Head = char:WaitForChild('Head', 10)
- if Head then
- TrackHum(v, vHRP2)
- else
- warn('COULD NOT TRACK: Player not spawning!')
- end
- end)
- local ChildRemove; ChildRemove = Players.PlayerRemoving:connect(function(Plr)
- if Plr == v then
- ChildRemove:disconnect();
- OnAdded:disconnect();
- end
- end)
- end
- for i,v in pairs(Players:GetPlayers()) do
- if not (v == Player) then
- spawn(function()Track(v)end)
- end
- end
- Players.PlayerAdded:connect(function(Plr)
- Track(Plr)
- end)
- warn'Loaded'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement