Advertisement
Aeyao

aaaaaa

May 7th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. local remove_hats = false
  2.  
  3.  
  4.  
  5. local morph1 = script.Parent
  6. for i,v in next,morph1:GetChildren() do
  7. if v:IsA("Model") then
  8. Instance.new("Humanoid",v)
  9. if script.Parent.Clothing:FindFirstChildOfClass("Shirt") then
  10. script.Parent.Clothing:FindFirstChildOfClass("Shirt"):Clone().Parent = v
  11. end
  12. if script.Parent.Clothing:FindFirstChildOfClass("Pants") then
  13. script.Parent.Clothing:FindFirstChildOfClass("Pants"):Clone().Parent = v
  14. end
  15. if script.Parent.Clothing:FindFirstChildOfClass("ShirtGraphic") then
  16. script.Parent.Clothing:FindFirstChildOfClass("ShirtGraphic"):Clone().Parent = v
  17. end
  18. end
  19. end
  20. local function assign(c)
  21. local morph = script.Parent:Clone()
  22. local function assemble(m,p,n)
  23. for i,v in next,m:GetChildren() do
  24. if v:IsA("Model") then
  25. assemble(v,p,n)
  26. else
  27. if v:IsA("Humanoid") then
  28. v:Destroy()
  29. elseif v:IsA("Shirt") then
  30. v:Destroy()
  31. elseif v:IsA("Pants") then
  32. v:Destroy()
  33. elseif v:IsA("ShirtGraphic") then
  34. v:Destroy()
  35. else
  36. local weld = Instance.new("Weld")
  37. weld.Part0 = v
  38. weld.Part1 = p
  39. weld.C0 = v.CFrame:inverse()*p.CFrame
  40. weld.Parent = p
  41. v.Anchored = false
  42. v.CanCollide = false
  43. if v.Name == n then
  44. v.Transparency = 1
  45. end
  46. end
  47. end
  48. end
  49. end
  50. local function cmtp(m)
  51. assemble(m,m[m.Name],m.Name)
  52. local weld = Instance.new("Weld")
  53. weld.Part0 = c[m.Name]
  54. weld.Part1 = m[m.Name]
  55. weld.Parent = c[m.Name]
  56. m.Parent = c
  57. end
  58. for i,v in next,morph:GetChildren() do
  59. if v:IsA("Model") then
  60. cmtp(v)
  61. end
  62. end
  63.  
  64. if script.Parent.Clothing:FindFirstChildOfClass("Shirt") then
  65. if c:FindFirstChildOfClass("Shirt") then
  66. c:FindFirstChildOfClass("Shirt"):Destroy()
  67. end
  68. script.Parent.Clothing:FindFirstChildOfClass("Shirt"):Clone().Parent = c
  69. end
  70. if script.Parent.Clothing:FindFirstChildOfClass("Pants") then
  71. if c:FindFirstChildOfClass("Pants") then
  72. c:FindFirstChildOfClass("Pants"):Destroy()
  73. end
  74. script.Parent.Clothing:FindFirstChildOfClass("Pants"):Clone().Parent = c
  75. end
  76. if script.Parent.Clothing:FindFirstChildOfClass("ShirtGraphic") then
  77. script.Parent.Clothing:FindFirstChildOfClass("ShirtGraphic"):Clone().Parent = c
  78. end
  79. if c:FindFirstChildOfClass("ShirtGraphic") then
  80. c:FindFirstChildOfClass("ShirtGraphic"):Destroy()
  81. end
  82. if remove_hats == true then
  83. for i,v in next,c:GetChildren() do
  84. if v:IsA("Accessory") then
  85. v:Destroy()
  86. end
  87. end
  88. end
  89. end
  90. local db = false
  91. script.Parent.Button.Touched:connect(function(hit)
  92. if game.Players:FindFirstChild(hit.Parent.Name) and db == false then
  93. db = true
  94. assign(hit.Parent)
  95. wait(5)
  96. db = false
  97. end
  98. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement