I have attempted to loop through the player list to check if that player exists, however the problem with that is that if the player is not in the game it errors.
Please note the method would need to work with other names for example:
timmy_123xx3 on Obby_3
in the listed above I would need to get timmy_123xx3 and Obby_3 out of the string.
I tried to look on string documentation however failed to find anything on this topic.
There’s no reason to use string.split there. string.split is useful when there are multiple occurrences. You can use a simple string pattern here: local name, obby = string.match("samjay22 on Obby", "^(%S+) on (%S+)$"). This is more general/flexible, too; you could easily change it to not only accept “on” as the second word (by changing “on” to “%S+”).