How can I make a scroll bar become bigger and bigger as players join?

Hiya!

I’m trying to make a player report type of thing. Basically, it’ll be a horizontal scrolling frame of avatars (of all the players in the server). But, I want it to adjust the scrolling bar’s size according to the amount of players in the server, (as it’ll be refreshing a lot and I don’t want the little avatar squares going vertical)

How can I complete this? I’ve provided an example below.

1 Like

Hey there!

I don’t think you should be asking for straight-up scripts here, but I’ve provided something that might assist you with your goal below:

  • You need to make a ScrollingFrame for the GUI so you can scroll through the players horizontally.
  • You’d need to use the PlayerAdded event in a LocalScript which should fire a RemoteEvent. This RemoteEvent should be linked to a ServerScript.
  • I can’t provide the actualy script as it’d take a while for me to work out, but let me know if you need any further assistance with this! :slight_smile:
1 Like

Hey! Thanks for replying, I’m going to read through what you’ve sent. The intension was not for people to send me exact scripts. I just wanted an idea on how to do so. :grinning_face_with_smiling_eyes:
I’m a programmer myself haha.

Alright, no worries! :grinning_face_with_smiling_eyes:

I’ve already completed the actual cloning of frames to get all players in a server. I was just wondering on how I should approach enlarging the scrolling frame as the amount of players gets bigger.

You can look at this in the documentation, it can probably help you

1 Like

You can utilize a UIGridLayout and adjust the CanvasSize property of the ScrollingFrame to match the amount of cells inside.

The following post provides an explanation of this along with code that can detect whenever a GuiObject inside of the ScrollingFrame is added/removed to accommodate for the amount of items contained within it. The main change that would need to be made from the code provided there is the axis that will be adjusted.

2 Likes

Thanks, this seems to be what I was looking for. :slight_smile:

1 Like

Ah, I think other people are currently helping you with this so I’ll step away!

1 Like

Yeah, thank you so much for the help though! I appreciate it.

1 Like