Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Checking if someone has applied (TRELLO API)?

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?

1 answer

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)

Wiki Link

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

Wiki Link

This discussion is preserved as it was. New answers, comments, and votes are closed.