I have a part called "Checkpoint2", and inside it, there is a script with this function
print(string.gsub(script.Parent.Name, "Checkpoint", ""))
called when Touched.
It should print "2" , shouldn't it? too bad, cause it prints "2 1" and I have no idea why... I've tried to make a second string.gsub to remove the " 1" , but then it prints "2 0" ! Can someone see an error here? (the rest of the script is useless)

3 comments
It's kinda weird, but it worked. Thanks.
If you added a comma to the str varialbe and added an matches variable after the comma, if you printed the matches variable, I assume it would print the number of matches it found, correct?
Correct