Advertisement
Nova355killer

Chams All

Apr 18th, 2019
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. local Players = game:GetService'Players'
  2. local Player = Players.LocalPlayer
  3. local ShowInvisibleParts = true;
  4.  
  5. function TrackHum(v, vHRP)
  6. local InvisibruParts = {}
  7. repeat wait(.4) until #vHRP.Parent:GetChildren() > 4
  8. for ii,vv in pairs(vHRP.Parent:GetChildren()) do
  9. if vv:IsA'BasePart' then
  10. local Box = Instance.new('BoxHandleAdornment', workspace)
  11. Box.Adornee = vv
  12. Box.Size = vv:GetMass() > 1 and vv.Size-Vector3.new(.1,.1,.1) or Vector3.new(.4,.4,.4)
  13. Box.Transparency = (vv.Transparency < 1 or ShowInvisibleParts) and .5 or 1
  14. Box.AlwaysOnTop = true
  15. Box.ZIndex = 1
  16.  
  17. Box.Color3 = Color3.new(242, 243, 243)
  18.  
  19. InvisibruParts[#InvisibruParts+1] = Box
  20.  
  21. local OnChange = not ShowInvisibleParts and vv.Changed:connect(function(Prop)
  22. if Prop == 'Transparency' then
  23. Box.Transparency = vv.Transparency < 1 and .5 or 1
  24. Box.Transparency = Color3.new(242, 243, 243)
  25. end
  26. end)
  27. local VChange = v.Changed:connect(function(Prop)
  28. if Prop == 'TeamColor' then
  29. Box.Color3 = Color3.new(242, 243, 243)
  30. end
  31. end)
  32.  
  33. local PlayerChange = Player.Changed:connect(function(Prop)
  34. if Prop == 'TeamColor' then
  35. Box.Color3 = Color3.new(242, 243, 243)
  36. end
  37. end)
  38.  
  39. local OnRemove; OnRemove = Player.CharacterRemoving:connect(function()
  40. Box:Destroy()
  41. VChange:disconnect()
  42. if not ShowInvisibleParts then
  43. OnChange:disconnect()
  44. end;
  45. PlayerChange:disconnect()
  46. OnRemove:disconnect()
  47. end)
  48. end
  49. end
  50. end
  51.  
  52. function Track(v)
  53. warn(v.Name..' is being tracked', v and v.Character and #v.Character:GetChildren())
  54. local vHum = v and v.Character and v.Character:FindFirstChild'Humanoid'
  55. local vHRP = vHum and vHum.Parent:FindFirstChild'HumanoidRootPart'
  56.  
  57. if vHRP and vHum.Health > 0 then
  58. local Head = v.Character:WaitForChild('Head', 10)
  59. if Head then
  60. TrackHum(v, vHRP)
  61. else
  62. warn('Head not found in Player: '..v.Name)
  63. end
  64. end
  65. local OnAdded = v.CharacterAdded:connect(function(char)
  66. local vHRP2 = char:WaitForChild'HumanoidRootPart'
  67. local Head = char:WaitForChild('Head', 10)
  68. if Head then
  69. TrackHum(v, vHRP2)
  70. else
  71. warn('COULD NOT TRACK: Player not spawning!')
  72. end
  73. end)
  74. local ChildRemove; ChildRemove = Players.PlayerRemoving:connect(function(Plr)
  75. if Plr == v then
  76. ChildRemove:disconnect();
  77. OnAdded:disconnect();
  78. end
  79. end)
  80. end
  81.  
  82. for i,v in pairs(Players:GetPlayers()) do
  83. if not (v == Player) then
  84. spawn(function()Track(v)end)
  85. end
  86. end
  87.  
  88. Players.PlayerAdded:connect(function(Plr)
  89. Track(Plr)
  90. end)
  91.  
  92. warn'Loaded'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement