I'm trying to make a Player List GUI and I made this, but it works in a Script and not a LocalScript.
game.Players.ChildAdded:connect(function(pl)
table.insert(plrs,pl.Name)
for i,v in next, plrs do
if (plrs[i]) == pl.Name then
local m = Instance.new("Message",workspace)
m.Text = "Player is #"..i.." and his name is "..v
end
end
end)
Now, the point of that script is to get a players index value and place his picture on to a ImageLabel, but that's not what I need help with right now. I need help with getting it into a LocalScript. Any ideas?

1 comment
First, use game.Players.PlayerAdded:connect(function(plr), also use for _,v in pairs(Plrs) do if v == pl.Name then. Also, m.Text = ('Player is #'..v.userId..' and his name is '..v.Name)