Hello all, I’m trying to create a lobby system and one of my problems currently is trying to load frames (Or as I call them “Chips” or “Widgets”) on clients that join this is my code currently:
local chip = game.ReplicatedStorage.Lobby_Chip_Template
local newChip
local addPos = 0.113
local currentPosY = 0.069
loadLobbies.OnClientEvent:Connect(function(player, lobby)
for _, item in pairs(lobby) do
local lobbiesScroller = plr.PlayerGui.MenuUI.Main_Frame.Popups.Play_Popup.Lobbies_Scroller
local addPos1 = 0.113
local currentPosY1 = 0.069
local loadChips = chip:Clone()
loadChips.Name = lobby.lobbyName
loadChips.Lobby_Name.Text = lobby.lobbyName
loadChips.Lobby_Size.Text = lobby.lobbySize
loadChips.Visible = true
loadChips.Parent = lobbiesScroller
loadChips.Position = UDim2.new(0.211, 0, currentPosY1, 0)
currentPosY1 = currentPosY1 + addPos1
print("Lobby loaded:", lobby)
end
end)
Lobby is a module script and this is what it looks like as well:
local lobbies = {
lobbies = {
"OnlyTwentyCharacter's lobby" = {
lobbyName = "OnlyTwentyCharacter's lobby",
lobbyPassword = "MyPasswordWasHere!",
friendsOnly = true,
lobbySize = "1/2",
CreatedOn = 1734823407
}
}
}
function lobbies.AddNewTable(player, lobbyName, lobbyPassword, friendsOnly)
local newTable = {
lobbyName = lobbyName,
lobbyPassword = lobbyPassword,
friendsOnly = friendsOnly,
lobbySize = "1/2",
CreatedOn = os.time()
}
lobbies.lobbies[lobbyName] = newTable
print(lobbies.lobbies)
end
return lobbies
Any help would be appreciated thanks in advance