#Player info script only loads my image
1 messages · Page 1 of 1 (latest)
script for reference:
local plrs = game.Players
local user
local nick
local pc = game:GetService("UserInputService").MouseEnabled
repeat wait() until script.Parent.Parent.Name == "PlayerFrame"
game:GetService("ReplicatedStorage").PlayerIcon2.OnClientEvent:Connect(function(plr, voting)
user = plr.Name
nick = plr.DisplayName
local playericon = plrs:GetUserThumbnailAsync(
plr.UserId,
Enum.ThumbnailType.HeadShot,
Enum.ThumbnailSize.Size150x150
)
script.Parent.ImageLabel.Image = playericon
end)```
i didnt get what you trying to do
you want all player thumbnails?
yes
then why dont just loop through players?
and have event for when player join and leaves
client
also why does it load player info correctly but not the thumbnail
lowk just ask ai
...why?
who is he
Are you stupid...
wait
why are you using he/him for an inanimate object
anyways
i printed the parameters
turns out it prints my user twice
that means soemhow there's a fixed parameter and a flexible parameter? idk
What you wrote:
game:GetService("ReplicatedStorage").PlayerIcon2.OnClientEvent:Connect(function(plr, voting)
This is on the client, so:
The first parameter plr is not actually the target player.
Roblox does not automatically pass arguments like that to each player unless you explicitly do it from the server.
You're probably receiving your own info, or the event is only firing on your own client, always using your own plr value.
Solution
game:GetService("ReplicatedStorage").PlayerIcon2.OnClientEvent:Connect(function(userId, username, displayName)
local playerIcon = plrs:GetUserThumbnailAsync(
userId,
Enum.ThumbnailType.HeadShot,
Enum.ThumbnailSize.Size150x150
)
local playerFrame = script.Parent --IF its your UI template
playerFrame.ImageLabel.Image = playerIcon
playerFrame.Username.Text = username
playerFrame.DisplayName.Text = displayName
end)```
@winged dome