To be honest, I have no idea how I was gonna name this. Still, don't know if that's a good title.
Anyway, I'm making an interview center for a group, and not one of those 1 players GUI application type game, just one of those where you go in, someone interviews you etc. Well, I don't want 10 million people in the same room bothering the two people interviewing. So I'm making a system for that.
So my first question, I made a for i loop, and I did make it right, it posts the textbutton yada yada, but I'm wondering how I post each players name through the loop code:
local players = game.Players:GetChildren()
function SetUpNames()
gui.Interviewer.SelectPlayer.Size = UDim2.new(1, 0, 0, 500)
for i = 1, #players do
local playername = Instance.new("TextButton")
playername.Name = "PlayerName"
playername.Size = UDim2.new(0, 200, 0, 25)
playername.Position = UDim2.new(0, 0, 0, (150*i)-150)
playername.Text = i --what do i do here?
playername.Parent = gui.Interviewer.SelectPlayer
end
end
Second question, How do I detect when the person clicks on a name? I can't do this manually because
- I don't know everyone's name
- The amount of people there will be different every time
I do not have any code because I am 100% clear I have no clue how to do it. I don't even know if it's possible, if it isn't, then I'll think of a new way. Probably would have them enter the name with a text box, then with that name search through all the players?
This is all done in a local script, inside the gui.
Any help would be gladly appreciated.
Questions? Comments? Concerns, make sure to comment and I'll try my best to answer them. -John

3 comments
"what do i do here?" i fix it an you downvote me, kid, also you cant detect a players name when they click
'i fix it an you downvote me, kid' what?
I never downvoted you