Player's profile on a GUI

In my story game, there will be dialogue. I was wondering how I could get a RANDOM player’s profile like a thumbnail and put it on a ImageLabel to make it look like that randomly selected player in the server said those words.

Another thing is how could I choose a specific player that did a task. For example if a player found a key, I want that player’s profile that found the key.
(Ex: Profile of player who found the key: “I found the key”)

Use this to retrieve a random number (to retrieve a random player in the game):

Use this to retrieve the image given a UserId: Players | Documentation - Roblox Creator Hub

You should be able to do the rest yourself, as we aren’t supposed to serve entire scripts or systems.

not entirely sure what you want, but if you want one simple line:

local randomPlayer = game:GetService("Players"):GetPlayers()[math.random(#game:GetService("Players"):GetPlayers())]

above guy was right, you do actually have to use math.random

Appreciate it! I could learn from this. :+1: