I don't know if this one will work but you can try
prontera,161,180,4 script Mr. Nick 709,{
mes "Hello there! I am Nick, the Guild Name changer."
mes "you can use my service if you have TCG and 50 Million Zennies! "
next;
mes "Input new name";
input @NewName$;
if(countitem(7227) || Zeny < 50000000) {
mes "I do apologize but you did not meet my requirements..";
close;
}
next;
mes "Please relog for the changes to take effect";
query_sql("UPDATE `name` FROM `guild` SET `name`='"+@NewName$+"' WHERE `name`='"+strcharinfo(2)+"'");
delitem 7227,1;
set Zeny,Zeny-50000000;
close;
I used +strcharinfo(2)+ because type "2" is for the name of the guild and "0" is for the player(as per wiki), but I'm not so sure about this...