local Players = game:GetService("Players")
local content
local PLACEHOLDER_IMAGE = "rbxassetid://1574674476" -- replace with placeholder image
local eotdPhoto
local validEotd = false
local timeout = 5
local elapsed = 0
while not validEotd and elapsed < timeout do
if shared.eotd == 0 or shared.eotd == 1 or shared.eotd == 2 then
validEotd = true
break
end
task.wait(0.2)
elapsed = elapsed + 0.2
end
if not validEotd then
warn("EOTD Displayer: shared.eotd is not set or invalid after waiting.")
content = PLACEHOLDER_IMAGE
eotdPhoto = "Elliot"
else
-- fetch the thumbnail
local thumbType = Enum.ThumbnailType.AvatarThumbnail
local thumbSize = Enum.ThumbnailSize.Size420x420
if shared.eotd == 0 then
content = Players:GetUserThumbnailAsync(862478431, thumbType, thumbSize)
eotdPhoto = Players:GetNameFromUserIdAsync(862478431)
print("Employee of the day is Noxturnum2")
elseif shared.eotd == 1 then
content = Players:GetUserThumbnailAsync(273362069, thumbType, thumbSize)
eotdPhoto = Players:GetNameFromUserIdAsync(273362069)
print("Employee of the day is VoidLord0")
elseif shared.eotd == 2 then
content = Players:GetUserThumbnailAsync(shared.selectedPlayer, thumbType, thumbSize)
eotdPhoto = Players:GetNameFromUserIdAsync(shared.selectedPlayer)
print("Employee of the day is a random player.")
end
end
-- set the Decal's content to the user thumbnail
local imageLabel = script.Parent:FindFirstChild("Picture")
if imageLabel then
local decal = imageLabel:FindFirstChild("Decal")
if decal then
decal.Texture = content or PLACEHOLDER_IMAGE
else
warn("EOTD Displayer: Decal not found in Picture part.")
end
else
warn("EOTD Displayer: Picture part not found.")
end
local namePart = script.Parent:FindFirstChild("Name")
if namePart then
local surfaceGui = namePart:FindFirstChild("SurfaceGui")
if surfaceGui then
local textLabel = surfaceGui:FindFirstChild("TextLabel")
if textLabel then
textLabel.Text = shared.selectedPlayerName or "Elliot"
else
warn("EOTD Displayer: TextLabel not found in SurfaceGui.")
end
else
warn("EOTD Displayer: SurfaceGui not found in Name part.")
end
else
warn("EOTD Displayer: Name part not found.")
end
(when playing)(when viewed in studio)
I need any texture returned by GetUserThumbnailAsync to expand to fill the whole face of the part as seen in studio with the default image, but as you can see it’s way too small right now.
Also for some reason, when the EOTD chosen is me (Noxturnum2) the thumbnail is skewed to the right?
And just for good measure I’ll show how it looks when the eotd is a random player (it’s supposed to be a random person in the server, but maybe GetPlayers() works weirdly when playtesting in studio? I’ll send the code just in case im wrong (this is in serverscriptservice)
shared.eotd = math.random(0,2)
shared.selectedPlayer = 1
if shared.eotd == 2 then
local Players = game:GetService("Players")
local playerList = Players:GetPlayers()
if #playerList > 0 then
local randomIndex = math.random(1, #playerList)
shared.selectedPlayer = playerList[randomIndex].UserId
shared.selectedPlayerName = playerList[randomIndex].Name
print("Random selected user is "..shared.selectedPlayerName)
else warn("Player list was empty; no user selected. Defaulting to user id 1")
end
end



