How would I remove a game from a server list? (Trello API)

Right now I have a global server list in my game, and it runs on trello to stay global.
image


When a card is deleted in the list, it is removed from the lobby.
I wrote a simple script to remove the card when a player leaves and players has only 1 child.

   game.Players.PlayerRemoving:Connect(function()
players = game.Players:GetChildren()
	if tonumber(#players) == 1 then
		print("13")
		print(tonumber(#players))
		servercard:Delete()
		wait(15)
		print("kicking players in 15 seconds")
		shutdown()
	end
end)

For some reason, this doesn’t work.

I’m using this trello API:

The function runs just fine and there are no errors, but it just doesn’t delete the server card in trello.

1 Like

Ended up fixing it myself, not sure what the problem was.

You should use BindToClose instead, your current method isn’t reliable.

Oh, you’re right. Sorry i’m still rather new to scripting, thank you.