Hi. I have been making an among us type game. I have been trying to make an emergency button. It supposed to use a picture of the player's character. (It does not work) This is the CODE:
script.Parent.Emergency.OnServerEvent:Connect(function(player)
local Players = game:GetService("Players")
print(player.UserId)
local userId = player.UserId
local thumbType = Enum.ThumbnailType.HeadShot
local thumbSize = Enum.ThumbnailSize.Size420x420
local content, isReady = Players:GetUserThumbnailAsync(userId, thumbType, thumbSize)
-- Set the ImageLabel's content to the user thumbnail
local imageLabel = game.StarterGui.Emergency.Frame.ImageLabel
imageLabel.Image = content
imageLabel.Size = UDim2.new(0, 250, 0, 250)
game.StarterGui.Emergency.Frame.Visible = true
wait(2)
game.StarterGui.Emergency.Frame.Visible = false
end)
Please help :). Thanks

1 comment
You're doing this on the server. I recommend manipulating GUIs on the client. Also use Player.PlayerGui not game.StaterGui.