Why wont the player picture load? the imagelabel image is set however the iamge doesnt actually show? am i doing something wrong?
local RepStorage = game:GetService("ReplicatedStorage")
local GPEvent = RepStorage:WaitForChild("Events").GamePlay.GameStart
local Gameend = RepStorage:WaitForChild("Events").GamePlay.GameEnd
local GameMessageModule = require(game.ReplicatedStorage:WaitForChild("Modules").GameMessageModule)
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local ui = player.PlayerGui
local PlayerDataUI = ui:WaitForChild("PlayerData"):WaitForChild("Frame")
local gamestarttext = PlayerDataUI.GameStart.TextLabel
local gamestarttextstroke = PlayerDataUI.GameStart["TextLabel-stroke"]
local Players = game:GetService("Players")
local BoatsFolder = workspace:WaitForChild("Boats")
local function applyBoatPhoto(boat)
task.wait(5)
local identValue = boat:FindFirstChild("Ident")
local playerName = identValue.Value
local player = Players:FindFirstChild(playerName)
if not player then return end
-- Get player UserId
local userId = player.UserId
-- Apply the image to the boat's ImageLabel
local imageLabel = boat:FindFirstChild("Data").BillboardGuiPhoto.Frame.ImageLabel
imageLabel.Image = Players:GetUserThumbnailAsync(userId, Enum.ThumbnailType.AvatarBust, Enum.ThumbnailSize.Size100x100)
end
-- Setup: run for existing boats…
for _, boat in ipairs(BoatsFolder:GetChildren()) do
applyBoatPhoto(boat)
end
-- …and any future ones
BoatsFolder.ChildAdded:Connect(applyBoatPhoto)