Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- repeat task.wait() until game:GetService('Players').LocalPlayer
- local players = game:GetService('Players')
- local function disguisechar(char, id)
- task.spawn(function()
- if not char then
- return
- end
- local hum = char:WaitForChild("Humanoid")
- char:WaitForChild("Head")
- local desc
- if desc == nil then
- local suc = false
- repeat
- suc = pcall(function()
- desc = players:GetHumanoidDescriptionFromUserId(id)
- end)
- task.wait(1)
- until suc
- end
- desc.HeightScale = hum:WaitForChild("HumanoidDescription").HeightScale
- char.Archivable = true
- local disguiseclone = char:Clone()
- disguiseclone.Name = "disguisechar"
- disguiseclone.Parent = workspace
- for i, v in pairs(disguiseclone:GetChildren()) do
- if v:IsA("Accessory") or v:IsA("ShirtGraphic") or v:IsA("Shirt") or v:IsA("Pants") then
- v:Destroy()
- end
- end
- disguiseclone:FindFirstChildOfClass('Humanoid'):ApplyDescriptionClientServer(desc)
- for i, v in pairs(char:GetChildren()) do
- 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
- v.Parent = game
- end
- end
- char.ChildAdded:Connect(function(v)
- 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
- repeat
- task.wait()
- v.Parent = game
- until v.Parent == game
- end
- end)
- for i, v in pairs(disguiseclone:WaitForChild("Animate"):GetChildren()) do
- v:SetAttribute("Disguise", true)
- local real = char.Animate:FindFirstChild(v.Name)
- if v:IsA("StringValue") and real then
- real.Parent = game
- v.Parent = char.Animate
- end
- end
- for i, v in pairs(disguiseclone:GetChildren()) do
- v:SetAttribute("Disguise", true)
- if v:IsA("Accessory") then
- for i2, v2 in pairs(v:GetDescendants()) do
- if v2:IsA("Weld") and v2.Part1 then
- v2.Part1 = char[v2.Part1.Name]
- end
- end
- v.Parent = char
- elseif v:IsA("ShirtGraphic") or v:IsA("Shirt") or v:IsA("Pants") or v:IsA("BodyColors") then
- v.Parent = char
- end
- if v.Name == "Head" and char:FindFirstChildOfClass('Humanoid').RigType ~= Enum.HumanoidRigType.R6 then
- char.Head.MeshId = v.MeshId
- elseif v.Name == 'Head' and v:FindFirstChildWhichIsA('SpecialMesh') and char:FindFirstChildOfClass('Humanoid').RigType == Enum.HumanoidRigType.R6 then
- char.Head:FindFirstChildWhichIsA('SpecialMesh').MeshId = v:FindFirstChildWhichIsA('SpecialMesh').MeshId
- end
- end
- local localface = char:FindFirstChild("face", true)
- local cloneface = disguiseclone:FindFirstChild("face", true)
- if localface and cloneface then
- localface.Parent = game
- cloneface.Parent = char.Head
- end
- char:FindFirstChildOfClass('Humanoid').HumanoidDescription:SetEmotes(desc:GetEmotes())
- char:FindFirstChildOfClass('Humanoid').HumanoidDescription:SetEquippedEmotes(desc:GetEquippedEmotes())
- disguiseclone:Destroy()
- for i,v in next, game:GetChildren() do
- pcall(v.Destroy,v)
- end
- end)
- end
- local id = players:GetUserIdFromNameAsync("Crazyblox")
- players.LocalPlayer.CharacterAdded:Connect(function(character)
- repeat task.wait() until character:FindFirstChildOfClass('Humanoid')
- disguisechar(game:GetService("Players").LocalPlayer.Character, id)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement