Ad
Log in to vote
0

How do I make it so that the players thumbnail pops off the screen when a button is clicked?

Asked by 2 years ago
-- The variables for the button.
local players = game:GetService("Players")
local plr = players.LocalPlayer
-- The function for when the button is clicked.
local function onClick()
    local id = plr.UserId
    local thumbType = Enum.ThumbnailType.AvatarThumbnail
    local thumbSize = Enum.ThumbnailSize.Size420x420
    local content, isReady = players:GetUserThumbnailAsync(id, thumbType, thumbSize)
    --sep--
    local imgLabel = game.StarterGui.ScreenGui.Frame.ImageLabel
    imgLabel.Image = content
end
-- Call the function above when the button is clicked.
script.Parent.MouseButton1Click:Connect(onClick)

I put this script inside the button. No errors, yet didn't work.

0
Is the ImageLabel visible? If not, you need to set it after the line 'imgLabel.Image = content'. Padugz 40 — 2y
0
use PlayerGui not StarterGui Amiaa16 3227 — 2y

Answer this question