Hi!
My current Avatar Updater script does not really update very fast.
I have tried multiple outfits, and none of them seem to update. About 10 to be exact.
My script:
while task.wait() do
print("Changed")
script.Parent.Image = "https://www.roblox.com/bust-thumbnail/image?userId=133017837&width=420&height=420&format=png"
task.wait(50)
warn("Change inbound! (5 seconds)")
task.wait(5)
end
Video: https://streamable.com/sda2qz
How could this be improved?
Thanks!
(My screen recorder is trash and corrupted some of it, the thing where my avatar was dragged in Edge was my profile, showing that Roblox was updating it.)
It updated to the FNF BF from my normal avatar this afternoon, back and fourth twice, and now it’s stuck. I’m also not very experienced with viewport frames.
Before what would have happened is that your avatar thumbnail would become [content deleted] before Roblox would redraw the thumbnail every few days, however nowadays your thumbnail will just remain the same from when it was before you changed it (I think).
For viewport frames, they are a bit laggier but they update immediately, also there is a separate problem your likely running into and that is image caching, after an image is downloaded, Roblox won’t redownload it despite the fact it changed.
local Players = game:GetService("Players") -- Canonical way to get a service
-- Simplified pcall
local success, image, ready = pcall(function ()
return Players:GetUserThumbnailAsync(133017837, Enum.ThumbnailType.AvatarThumbnail) -- OP requested avatar
end)
-- Direct pcall (preferable, as it does not create an anonymous function)
local success, image, ready = pcall(Players.GetThumbnailAsync, Players, 133017837, Enum.ThumbnailType.AvatarThumbnail)
if success then
if ready then
while task.wait() do
script.Parent.Image = image
end
else
warn("Image not ready!")
end
else
warn("Call failed!")
end
First create an ViewPortFrame and replace the ImageLabel with it, then insert a basic Dummy in the ViewPortFrame, you should also add a part called ‘cam’ and position (and orientate) it so it looks at where you wish the character to be shown at (looking at the head)
You would get the character’s current outfit through:
local Humanoid = --Path To Dummy's Humanoid
game.Players:GetHumanoidDescriptionFromUserId([UserId])
Humanoid:ApplyDescription(humanoidDescription)
Then in order to show the head of the character in a localscript inside the ViewPortFrame do the following:
local cam = Instance.new('Camera')
cam.Parent = script
script.Parent.CurrentCamera = cam
local CamPart = --Path To Dummy's 'Cam' part
cam.CFrame = CamPart.CFrame