Custom Player List Only Showing One Character

Hi all! I’ve been working on a custom player board but I’ve had issues with getting it to display all the characters. To get the circle clipping mask I used boatbomber’s image clipping module.

As you can see, It repeats my character icon over and over again. What could be causing it?

Script:

-- FilteredScript 2020 --

local ImageMask = require(script.ImageMask)

local players = game.Players
local playertable = players:GetPlayers()

local images = script.Parent.Main:GetChildren()

local Types		= {"Circle"}

for i=1, #Types do
	for e, table in pairs(playertable) do
		for a, image in pairs(images) do
			local Image	= "https://www.roblox.com/headshot-thumbnail/image?userId=".. table.UserId .."&width=420&height=420&format=png"
			if image == image then
				local f	= ImageMask.new(Image, Types[i])
				f.Parent = image
				f.Size = UDim2.new(0.9,0,0.9,0)
				f.SizeConstraint	= Enum.SizeConstraint.RelativeYY
				f.AnchorPoint = Vector2.new(0.5, 0.5)
				f.Position = UDim2.new(0.5, 0, 0.5, 0)							
			end
		end
	end
end

Any help would be appreciated :slight_smile:

2 Likes

A small thing I noticed, part of your code has:

if image == image then

And i’m assuming one of those should be Capitalised?

2 Likes

I tried that, Capitalizing it leads to blank icons. I think I just had that there for testing

Is the issue that your player is showing in every circle instead of all the players in the game?
Or is the issue that it should just be showing one circle with your character?

2 Likes

Well it’s kind of both… I want it to show in one circle only but It’s showing in all the circles.
I need it to show all the players icons

I’m not 100% sure if this will work as I don’t have your GUI, but give it a try. Assuming that script.Parent.Main contains all the frames to display player images, I changed your code so it looks at the player’s index (‘e’) e.g. player 1,2,3,4,5… and indexes script.Parent.Main with that - setting a single image per player.

local ImageMask = require(script.ImageMask)

local players = game.Players
local playertable = players:GetPlayers()

local images = script.Parent.Main:GetChildren()

local Types		= {"Circle"}

for i=1, #Types do
	for e, table in pairs(playertable) do
		local Image	= "https://www.roblox.com/headshot-thumbnail/image?userId=".. table.UserId .."&width=420&height=420&format=png"

		image = images:GetChildren()[e]
		local f	= ImageMask.new(Image, Types[i])
		f.Parent = image
		f.Size = UDim2.new(0.9,0,0.9,0)
		f.SizeConstraint	= Enum.SizeConstraint.RelativeYY
		f.AnchorPoint = Vector2.new(0.5, 0.5)
		f.Position = UDim2.new(0.5, 0, 0.5, 0)							
	end
end

If that doesn’t work, send a pic of how your GUI is currently layed out.

1 Like

image
The script you mentioned didnt work. The word ImageMask became underlined with red.
Any Ideas?

Note: The insets dont need to be changed, they’re just backgrounds for the icons

The word ImageMask became underlined with red

Apologies, I forgot to include the first line of your code in mine. Try it now.

11:14:41.739 - Players.FilteredScript.PlayerGui.PlayerIcons.IconHandler:14: attempt to call a nil value

I seem to be getting that error

Trying using this code:
image = images[e]

I think the problem is that you are defining the images variable as images = Script.Parent.Main:GetChildren() which then you are doing images:GetChildren()[e]. I think you just need to remove one of the :GetChildren() from @Naco88 codes