#Need help for list player

1 messages · Page 1 of 1 (latest)

winged wadi
#

Can someone help me i want to list all the player on the server on a scrollingframe

lethal hearth
#

For i, player in game.players:getplayers do

winged wadi
#

I send u my problem on mp

#

@lethal hearth

naive crystal
#
local frame=script.Parent
local function playerList()
    for i,v in pairs(players:GetPlayers()) do
        local label=Instance.new('TextLabel')
        label.Text=v.Name
label.Parent=frame
label.Size = UDim2.new(1, 0, 0, 30)
        label.Position = UDim2.new(0, 0, 0, (i - 1) * 30)
        end
end
local function deleteOld()
    for i,v in pairs(frame:GetChildren()) do
        if v:IsA('TextLabel') then
            v:Destroy()
        end
    end
end
deleteOld()
playerList()
game.Players.PlayerAdded:Connect(function()
    deleteOld()
    playerList()
end)
print('done')
game.Players.PlayerRemoving:Connect(function()
    deleteOld()
    playerList()
end)```
#

use a ui list layout

#

this should work fineThumbs

#

but yeah that logic is fine