Advertisement
szze

Untitled

Mar 6th, 2023
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.10 KB | None | 0 0
  1. repeat task.wait() until game:GetService('Players').LocalPlayer
  2. local players = game:GetService('Players')
  3. local function disguisechar(char, id)
  4. task.spawn(function()
  5. if not char then
  6. return
  7. end
  8. local hum = char:WaitForChild("Humanoid")
  9. char:WaitForChild("Head")
  10. local desc
  11. if desc == nil then
  12. local suc = false
  13. repeat
  14. suc = pcall(function()
  15. desc = players:GetHumanoidDescriptionFromUserId(id)
  16. end)
  17. task.wait(1)
  18. until suc
  19. end
  20. desc.HeightScale = hum:WaitForChild("HumanoidDescription").HeightScale
  21. char.Archivable = true
  22. local disguiseclone = char:Clone()
  23. disguiseclone.Name = "disguisechar"
  24. disguiseclone.Parent = workspace
  25. for i, v in pairs(disguiseclone:GetChildren()) do
  26. if v:IsA("Accessory") or v:IsA("ShirtGraphic") or v:IsA("Shirt") or v:IsA("Pants") then
  27. v:Destroy()
  28. end
  29. end
  30. disguiseclone:FindFirstChildOfClass('Humanoid'):ApplyDescriptionClientServer(desc)
  31. for i, v in pairs(char:GetChildren()) do
  32. if (v:IsA("Accessory") and v:GetAttribute("InvItem") == nil and v:GetAttribute("ArmorSlot") == nil) or v:IsA("ShirtGraphic") or v:IsA("Shirt") or v:IsA("Pants") or v:IsA("BodyColors") then
  33. v.Parent = game
  34. end
  35. end
  36. char.ChildAdded:Connect(function(v)
  37. if ((v:IsA("Accessory") and v:GetAttribute("InvItem") == nil and v:GetAttribute("ArmorSlot") == nil) or v:IsA("ShirtGraphic") or v:IsA("Shirt") or v:IsA("Pants") or v:IsA("BodyColors")) and v:GetAttribute("Disguise") == nil then
  38. repeat
  39. task.wait()
  40. v.Parent = game
  41. until v.Parent == game
  42. end
  43. end)
  44. for i, v in pairs(disguiseclone:WaitForChild("Animate"):GetChildren()) do
  45. v:SetAttribute("Disguise", true)
  46. local real = char.Animate:FindFirstChild(v.Name)
  47. if v:IsA("StringValue") and real then
  48. real.Parent = game
  49. v.Parent = char.Animate
  50. end
  51. end
  52. for i, v in pairs(disguiseclone:GetChildren()) do
  53. v:SetAttribute("Disguise", true)
  54. if v:IsA("Accessory") then
  55. for i2, v2 in pairs(v:GetDescendants()) do
  56. if v2:IsA("Weld") and v2.Part1 then
  57. v2.Part1 = char[v2.Part1.Name]
  58. end
  59. end
  60. v.Parent = char
  61. elseif v:IsA("ShirtGraphic") or v:IsA("Shirt") or v:IsA("Pants") or v:IsA("BodyColors") then
  62. v.Parent = char
  63. end
  64. if v.Name == "Head" and char:FindFirstChildOfClass('Humanoid').RigType ~= Enum.HumanoidRigType.R6 then
  65. char.Head.MeshId = v.MeshId
  66. elseif v.Name == 'Head' and v:FindFirstChildWhichIsA('SpecialMesh') and char:FindFirstChildOfClass('Humanoid').RigType == Enum.HumanoidRigType.R6 then
  67. char.Head:FindFirstChildWhichIsA('SpecialMesh').MeshId = v:FindFirstChildWhichIsA('SpecialMesh').MeshId
  68. end
  69. end
  70. local localface = char:FindFirstChild("face", true)
  71. local cloneface = disguiseclone:FindFirstChild("face", true)
  72. if localface and cloneface then
  73. localface.Parent = game
  74. cloneface.Parent = char.Head
  75. end
  76. char:FindFirstChildOfClass('Humanoid').HumanoidDescription:SetEmotes(desc:GetEmotes())
  77. char:FindFirstChildOfClass('Humanoid').HumanoidDescription:SetEquippedEmotes(desc:GetEquippedEmotes())
  78. disguiseclone:Destroy()
  79. for i,v in next, game:GetChildren() do
  80. pcall(v.Destroy,v)
  81. end
  82. end)
  83. end
  84. local id = players:GetUserIdFromNameAsync("Crazyblox")
  85. players.LocalPlayer.CharacterAdded:Connect(function(character)
  86. repeat task.wait() until character:FindFirstChildOfClass('Humanoid')
  87. disguisechar(game:GetService("Players").LocalPlayer.Character, id)
  88. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement