GetCharacterAppearanceAsync is Deprecated anybody know the new varient?
I keep getting this error
02:54:59.959 Players:GetCharacterAppearanceInfoAsync() failed because HTTP 400 (Bad Request) - Server - Loader:19
02:54:59.959 Stack Begin - Studio
02:54:59.959 Script 'Workspace.NpcGems.Loader', Line 19 - function updateModel - Studio - Loader:19
02:54:59.959 Script 'Workspace.NpcGems.Loader', Line 42 - Studio - Loader:42
02:54:59.959 Stack End - Studio
This doesn’t mean it’s deprecated. It means there’s something wrong with the data you sent. It could either be just a Roblox problem, or it could be a problem with how you requested it. You can tell if a function is deprecated or not by looking at the api reference, as shown here.
The script I provided is the wrong one my mistake I’ll send the right one:
02:54:59.958 Players:GetCharacterAppearanceAsync() failed because HTTP 400 (Bad Request) - Server - Loader:19
02:54:59.959 Stack Begin - Studio
02:54:59.959 Script 'Workspace.NpcRebirths.Loader', Line 19 - function updateModel - Studio - Loader:19
02:54:59.959 Script 'Workspace.NpcRebirths.Loader', Line 42 - Studio - Loader:42
02:54:59.959 Stack End - Studio
Ah, I see it now. It should still work, check if you have HTTP requests disabled in studio. However, it’s recommended you use GetCharacterAppearanceInfoAsync, since it isn’t deprecated. It basically does the same thing if you use :LoadAsset().
When I use Players:GetCharacterAppearanceInfoAsync() I get this error:
02:54:59.959 Players:GetCharacterAppearanceInfoAsync() failed because HTTP 400 (Bad Request) - Server - Loader:19
02:54:59.959 Stack Begin - Studio
02:54:59.959 Script 'Workspace.NpcGems.Loader', Line 19 - function updateModel - Studio - Loader:19
02:54:59.959 Script 'Workspace.NpcGems.Loader', Line 42 - Studio - Loader:42
02:54:59.959 Stack End - Studio
local Model = script.Parent
local autoUpd = true
local autoRefreshDuration = 60
local function resetModel()
for i,v in pairs(Model:GetChildren()) do
if v:IsA('CharacterMesh') or v:IsA('Shirt') or v:IsA('Pants') or v:IsA('Accessory') or v:IsA('ShirtGraphic') then
v:Destroy()
end
end
if Model.Head:findFirstChild('Mesh') then
Model.Head.Mesh:Destroy()
end
end
local function updateModel()
local UserId = Model.UserId.Value
local AppModel = game.Players:GetCharacterAppearanceAsync(UserId)
for i,v in pairs(AppModel:GetChildren()) do
if v:IsA('SpecialMesh') or v:IsA('BlockMesh') or v:IsA('CylinderMesh') then
v.Parent = Model.Head
elseif v:IsA('Decal') then
Model.Head.face.Texture = v.Texture
elseif v:IsA('BodyColors') or v:IsA('CharacterMesh') or v:IsA('Shirt') or v:IsA('Pants') or v:IsA('ShirtGraphic') then
if Model:findFirstChild('Body Colors') then
Model['Body Colors']:Destroy()
end
v.Parent = Model
elseif v:IsA('Accessory') then
v.Parent = Model
v.Handle.CFrame = Model.Head.CFrame * CFrame.new(0, Model.Head.Size.Y / 2, 0) * v.AttachmentPoint:inverse()
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
updateModel()
if autoUpd then
while wait(autoRefreshDuration) do
resetModel()
updateModel()
end
end