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?
Why do you need it in a LocalScript? It will only work in a normal script.
local Plrs = {} game.Players.PlayerAdded:connect(function(Player) table.insert(Plrs, {NM = Player.Name,ID = Player.userId} ) for _,v in pairs(Plrs) do if v.NM == Player.Name then local m = Instance.new('Hint',workspace) m.Text = ("Player is #"..v.ID.." and his/her name is "..v.NM.."!") end end end)