I have a SurfaceGui with an image that should update to a player’s thumbnail image when an event is fired. However, this often doesn’t work and the image doesn’t update. I can confirm the event is being fired.
Code:
local rs = game:GetService("ReplicatedStorage")
local rm = rs:WaitForChild("Remotes")
local remote = rm:WaitForChild("WinnerImage")
remote.OnClientEvent:Connect(function(id,plr)
print("Connected")
local userId = id
local thumbType = Enum.ThumbnailType.HeadShot
local thumbSize = Enum.ThumbnailSize.Size420x420
local content, isReady = game:GetService("Players"):GetUserThumbnailAsync(userId, thumbType, thumbSize)
--game.Workspace.Lobby.LastWinner.UI.SurfaceGui.ImageLabel.Image = nil
wait(1)
--isReady = true
game.Workspace.Lobby.LastWinner.UI.SurfaceGui.ImageLabel.Image = content
print("set")
end)
I’m not sure what you’re doing wrong, the script seems to be working perfectly fine with me. Make sure it’s a server script, in ServerScriptService or Workspace.
local __thumbnail = game:GetService("Players"):GetUserThumbnailAsync(1, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420);
Clients CANNOT communicate with each other like this, this is done on the server. I’m loosing braincells over this, this should not be an 17+ reply chain.