I just want to know how to make an R6 Statue of myself auto-loads, like this:
This is a free-model i took while searching around for it, but i would like to know if there is any more prathic way to do so, and ALSO how can i fix the missplaced hats? (Like the scarf?)
Script:
local Loader = {}
function Loader:resetModel(Model)
for _, Object in next, Model:GetChildren() do
if Object:IsA('CharacterMesh') or Object:IsA('Shirt') or Object:IsA('Pants') or Object:IsA('Hat') or Object:IsA('ShirtGraphic') then
Object:Destroy()
end
end
if Model.Head:findFirstChild('Mesh') then
Model.Head.Mesh:Destroy()
end
end
function Loader:updateModel(Model, userId)
local AppModel = game.Players:GetCharacterAppearanceAsync(userId)
Model.Name = game.Players:GetNameFromUserIdAsync(userId)
for _, Object in next, AppModel:GetChildren() do
if Object:IsA('SpecialMesh') or Object:IsA('BlockMesh') or Object:IsA('CylinderMesh') then
Object.Parent = Model.Head
elseif Object:IsA('Decal') then
Model.Head.face.Texture = Object.Texture
elseif Object:IsA('BodyColors') or Object:IsA('CharacterMesh') or Object:IsA('Shirt') or Object:IsA('Pants') or Object:IsA('ShirtGraphic') then
if Model:findFirstChild('Body Colors') then
Model['Body Colors']:Destroy()
end
Object.Parent = Model
elseif Object:IsA('Accessory') then
Object.Parent = Model
Object.Handle.CFrame = Model.Head.CFrame * CFrame.new(0, Model.Head.Size.Y / 2, 0) * Object.AttachmentPoint:inverse()
elseif Object:IsA('Folder') then
if Object.Name == 'R6' then
Object:GetChildren()[1].Parent = Model
end
else
print('Object: '..Object.Name..' is not recognised, type: '..Object.ClassName)
end
end
if not Model.Head:FindFirstChild('Mesh') then
local m = Instance.new('SpecialMesh', Model.Head)
m.MeshType = Enum.MeshType.Head
m.Scale = Vector3.new(1.25, 1.25, 1.25)
end
end
return Loader