Trello API problem

So this script is meant to check if a player is on a Trello API and if they are to print and if they aren’t on the API it is meant to print that they don’t own the product and to destroy the loader script.
Issue:
It doesn’t matter if the game creator’s ID is on the API or not, it just prints that the player does not own the product.

local TrelloAPI = require(game.ServerScriptService:WaitForChild("TrelloAPI"))
local BoardID = TrelloAPI:GetBoardID("ArenaSysOwners")

local ListID = TrelloAPI:GetListID("Owners",BoardID)

local gameid = game.CreatorId

game.Players.PlayerAdded:Connect(function(player)
	print("player joined")
	local Cards = TrelloAPI:GetCardsInList(ListID)
	for v,i in pairs(Cards) do
		print(Cards)
		if i.name == gameid then
			print("Game creator OWNS ArenaSys")
		else
			print("Game creator DOES NOT own ArenaSys")
			wait(0.1)
			game.ServerScriptService.ArenaSysLoader:Destroy()
		end	
	end
end)

Can anyone help me out?

1 Like

The creatorId of a game is the identifier number of the user who created the game. For example, if a user with the id of 12345 created the game, the creator id would become 12345. I do not understand what you are trying to create, but I don’t think that i.name is necessary.

try this.

game.Players.PlayerAdded:Connect(
    function(player)
        print('player joined')
        local Cards = TrelloAPI:GetCardsInList(ListID)
        for v, i in pairs(Cards) do
            print(Cards)
            if tonumber(i.name) == gameid then
                print('Game creator OWNS ArenaSys')
                return
            end
        end
        print('Game creator DOES NOT own ArenaSys')
        game.ServerScriptService.ArenaSysLoader:Destroy()
    end
)

Nope, still getting the same output

Right, and I am checking if the creator ID of the game is on the Trello API. If it’s on there it prints that the player owns, if they aren’t it prints that they aren’t and destroys the loader. The i.name is necessary to check all of the cards in the for loop to see if the player’s user id is in a card’s name.

Have you tried printing the GameId, i.name?

Yep, and both the creator ID on the Trello and the actual creator ID match up.

tonumber i.name just incase its a string.

Okay yes, I added tonumber() and everything works well now. I didn’t know that Trello outputted strings. Thanks a bunch!