I'm basically trying to make a lobby system for multiplayer but i'm running into this issue, so basically I have a system to connect the lobbies up and when the value of the lobby's amount of players gets changed it changes it for all clients. The issue is I have a loop to begin with but it already has connected the function up to a nil value which was suppost to be set in the loop before connected. Here are the parts of the script with the issue:
LobbyFound = false
game.Workspace.Lobbys.ChildAdded:Connect(function()
if LobbyFound == false then
LobbyList = game.Workspace.Lobbys:GetChildren()
for i, v in pairs(LobbyList) do
if LobbyList[i].Name == script.Parent.Parent.Name then
LobbyFound = true
LobbyLocation = LobbyList[i]
end
end
end
end)
LobbyLocation:GetPropertyChangedSignal("Value"):Connect(function()
if Status == "Join" then
script.Parent.Text = "Join" .. LobbyLocation.Value .. " / 4"
else
script.Parent.Text = "Leave" .. LobbyLocation.Value .. " / 4"
end
end)

1 comment
And no Im not going to set up the lobby variable manually because that would be boring.