Advertisement
HowToRoblox

ListHandler

Jun 26th, 2021
8,210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.53 KB | None | 0 0
  1. game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
  2.  
  3.  
  4. local template = script:WaitForChild("PlayerFrame")
  5.  
  6. local scroller = script.Parent:WaitForChild("PlayerScroller")
  7.  
  8.  
  9.  
  10. function updatePlayers()
  11.    
  12.    
  13.     for i, child in pairs(scroller:GetChildren()) do
  14.        
  15.         if child:IsA("Frame") then child:Destroy() end
  16.     end
  17.    
  18.    
  19.     for i, plr in pairs(game.Players:GetPlayers()) do
  20.        
  21.        
  22.         local img = game.Players:GetUserThumbnailAsync(plr.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)
  23.        
  24.        
  25.         local templateClone = template:Clone()
  26.        
  27.        
  28.         templateClone.DisplayName.Text = plr.DisplayName
  29.         templateClone.RealName.Text = "@" .. plr.Name
  30.        
  31.        
  32.         local part = Instance.new("Part")
  33.         part.Shape = Enum.PartType.Cylinder
  34.         part.Orientation = Vector3.new(0, -90, 0)
  35.         part.Size = Vector3.new(1, 1, 1)
  36.         part.Transparency = 1
  37.        
  38.        
  39.         local decal = Instance.new("Decal", part)
  40.         decal.Face = Enum.NormalId.Right
  41.        
  42.         decal.Texture = img
  43.        
  44.        
  45.         local camera = Instance.new("Camera")
  46.         camera.CFrame = part.CFrame * CFrame.Angles(0, math.rad(90), 0) + Vector3.new(0, 0, 1.25)
  47.        
  48.         templateClone.CharacterImage.CurrentCamera = camera
  49.         camera.Parent = templateClone.CharacterImage
  50.        
  51.         part.Parent = templateClone.CharacterImage
  52.        
  53.        
  54.         templateClone.Parent = scroller
  55.        
  56.        
  57.         scroller.CanvasSize = UDim2.new(0, 0, 0, scroller.UIListLayout.AbsoluteContentSize.Y)
  58.     end
  59. end
  60.  
  61.  
  62. updatePlayers()
  63. game.Players.PlayerAdded:Connect(updatePlayers)
  64. game.Players.PlayerRemoving:Connect(updatePlayers)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement