ThemodmenuX123456789

Chams

Jan 5th, 2023
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. local client = game.Players.LocalPlayer
  2. local players = game:GetService("Players")
  3. local rs = game:GetService("RunService")
  4.  
  5. local function clonePart(part, model, character)
  6. if part:IsA("BasePart") then
  7. local head = character:WaitForChild("Head")
  8. local clone = part:Clone()
  9. for i, v in ipairs(clone:GetChildren()) do
  10. if not v:IsA("SpecialMesh") then
  11. v:Destroy()
  12. continue
  13. end
  14. v.TextureId = ""
  15. end
  16. clone.Color = Color3.fromRGB(0, 255, 0)
  17. pcall(function()clone.Size = clone.Size * 0.7 clone.CanCollide = false end)
  18. clone.Parent = model
  19. rs.RenderStepped:connect(function()
  20. if head:IsDescendantOf(workspace) then
  21. clone.CFrame = part.CFrame
  22. clone.Size = part.Size
  23. else
  24. model:Destroy()
  25. return
  26. end
  27. end)
  28. end
  29. end
  30. local function chams(character)
  31. local model = Instance.new("Model")
  32. model.Name = character.Name
  33. model.Parent = workspace
  34. local cham = Instance.new("Highlight",model)
  35. cham.Name = "cham"
  36. cham.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
  37. cham.OutlineColor = Color3.fromRGB(0,0,0)
  38. cham.FillColor = Color3.fromRGB(255,0,0)
  39. cham.FillTransparency = 0
  40. cham.OutlineTransparency = 1
  41. local new = cham:Clone()
  42. new.Parent = character
  43. new.FillColor = Color3.fromRGB(0,255,0)
  44. new.DepthMode = Enum.HighlightDepthMode.Occluded
  45. for i,v in ipairs(character:GetChildren()) do
  46. -- if character has a head then
  47. if character:FindFirstChild("Head") then
  48. clonePart(v, model, character)
  49. end
  50. end
  51. end
  52. for i,v in ipairs(players:GetPlayers()) do
  53. if v~= client then
  54. if v.Character then
  55. chams(v.Character)
  56. end
  57. end
  58. v.CharacterAdded:connect(function()wait(0.1)chams(v.Character)end)
  59. end
  60. players.PlayerAdded:connect(function()
  61. if v~= client then
  62. if v.Character then
  63. chams(v.Character)
  64. end
  65. end
  66. v.CharacterAdded:connect(function()wait(0.1)chams(v.Character)end)
  67. end)
Add Comment
Please, Sign In to add comment