Looks good, pretty sure you could get rid of the check using a for loop and do something like this instead:
PHP Code:
temp.scanguilds.loadfolder("levels/guilds/guild*.txt",0);
temp.checkguild = "guild" @ replaceText(guildname, " ", "_") @ ".txt";
if (checkguild in scanguilds) {
// guild found
}
Maybe a placeholder function for custom guild systems could be added as well.