Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Player list only showing first person?

I am making a player list, and making it to pick someone as a suspect for something, but it's only working for the first person in the game, what did I do wrong?

Send.People:ClearAllChildren()
			local Spot = 0
			for _,v in pairs(game.Players:GetPlayers()) do
				local NT = PTab:Clone()
				NT.Parent = Send.People
				NT.Position = UDim2.new(0, 0, Spot, 0)
				NT.Name = v.Name
				NT.Text = v.Name
				Spot = Spot + 20
			end
			local Tabs = Send.People:GetChildren()
			for i = 1, #Tabs do
				Tabs[i].MouseButton1Down:connect(function()
					Send.Suspect.Value = Tabs[i].Name
					Send.SuspectLabel.Text = 'Selected Suspect: '..Tabs[i].Name
				end)
			end

2 comments

0

We might need a bit more than this...any errors?

0

No errors. And this is the entire part of it, the rest is just the button click.

1 answer

:O THIS LOOKS LIKE A JOB FOR... MESSORADMIN!!
cricket chirps
stfu cricket.

#Lol

function Update()
	Send.People:ClearAllChildren() -- Clear the gui
	local NewIndexTable = {}
	for i,v in next,game:GetService("Players"):GetPlayers() do
		local NewGui = PTab:Clone()
		NewGui.Parent = Send.People
		NewGui:TweenPosition(UDim2.new(0,0,(NewGui.Size.Y*#NewIndexTable),0), "In", "Quad",  1)
		NewGui.Name = v.Name -- Play around with the UDim2.. make it look good.. C:
		NewGui.Text = v.Name
		table.insert(NewIndexTable, NewGui)
		NewGui.MouseButton1Down:connect(function()
			Send.Suspect.Value = v.Name
			Send.SuspectLabel.Text = "Selected Suspect: "..v.Name
		end) -- Better then your for i loop c:
	end
end

Update()

This discussion is preserved as it was. New answers, comments, and votes are closed.