I've made a script that's supposed to check if the person who joined the game has already submitted an application.
It uses Trello Api.
Script:
game.Players.PlayerAdded:connect(function(player) for _,List in pairs (Card) do local Name,Id = List.name:match("(.) : (.)") if Name or Id then if Name:lower() == player.Name:lower() or Id == tostring(player.userId) then player:Kick("Sorry, you've already taken this test!") print("no") end else print("Player is eligible for test") end end end)
How can I get this to work?
Your matches are wrong.
You need to set the pattern to:
List.name:match("(.+) : (.+)")
The + symbol means that it is collecting a string of one or more characters, whereas your script was only looking for one (so it would have got the last letter of the name, and first number of the userId)
I'd also recommend changing the second to a digit pattern, so:
List.name:match("(.+) : (%d+)")
This means it will only look for (one or more) digits for the ID