hi i am making lobby system and when i check if the password is correct, it will add a player to the table, but it is just ignoring it
server script:
events.JoinPrivateLobby.OnServerEvent:Connect(function(plr)
local lobbysFrames = plr.PlayerGui.GameGUI.GameFrame.LobbyFrame
if lobbysFrames.PasswordPrompt.Password.Text == newLobby.Password.Value then
table.insert(playerTable, plr.Name)
print(playerTable)
elseif lobbysFrames.PasswordPrompt.Password.Text ~= newLobby.Password.Value then
print("invalid password")
end
end)
local script:
script.Parent.MouseButton1Down:Connect(function()
if script.Parent.Parent.Parent.isPrivate.Value == true then
game.ReplicatedStorage.Events.JoinPrivateLobby:FireServer()
end
end)