Hello Roblox scripting community, recently I’ve been trying to make a clan system where when a player is added to the clan, we see him appear in a list of players.
So I want to make a list of all the players currently present in the clan.
My problem is that I don’t know how to update the position of the frames in the scrolling frame. (For those who didn’t understand, I want frames to update much like Roblox chat messages)
I tried using UIListLayout but it doesn’t work, the frames that are cloned overlap.
As below:
What did you parent UIListLayout to? I use ScrollingFrames in combination with UIListLayout very often in my game, and it works, so either you have a special case or you’re using the element wrong.
Mind checking the settings of that UIListLayout, and if you parent the “player card” frames correctly into the ScrollingFrame and not elsewhere? If everything appears fine, send me an rbxm file of the gui without any scripts (if you can and want), I’ll try tinkering around a bit.
So I’ll try that, and if I can’t find it, I’ll send you a copy. But something bothers me, do you think it can be because of the clone I make in my script?
Ideally, this is how UIListLayout should behave with its default settings. Whenever it detects a new child (cloned, moved, created, etc), it will put it at the end, or make space for it somewhere in the middle, depending on how you create it.
NOTE: When I do not launch the game by roblox studio and I create new frames, it works very well, however, when I play and my script runs, the frames do not work
If that happens, then it appears to be an issue with your script instead of the UIListLayout. Double-check where you’re cloning the frames, and if you’re modifying their size or position?
I analyzed the script and I found out what’s wrong.
local slot = temp:Clone()
local ClanSlot = folder:Clone()
-- ...
ClanSlot.Parent = script.Parent.PlayerList
This piece of code creates a folder, clones the folder into the ScrollingFrame, and the player card into that folder. UIListLayout doesn’t know how to and cannot handle folders, so you have an option to clone the player card into the UIListLayout, and then the folder into it like this:
local slot = temp:Clone()
local ClanSlot = folder:Clone()
-- ...
slot.Parent = script.Parent.PlayerList
ClanSlot.Parent = slot
That should make the UIListLayout correctly handle multiple frames, and thus make the script working as intended.
If by “map” you mean the player’s frame, then yes. You can put the folder elsewhere, if you’d like to, but the frame must be parented to the ScrollingFrame.
Ok I see, you answer my question, by doing that I have to change my system, because basically I wanted the clans to be listed in folders then the player cards in this same folder. But
thanks you.