I don't think you understand what you're actually trying to do, what public functions are for, or how classes work.
Perhaps this is what you're trying to do:
Level NPC:
PHP Code:
function onCreated() {
this.quest_text = "My name is bob";
join("icon");
}
class: icon
PHP Code:
function onPlayerTouchsMe() {
say2(this.quest_text);
}
A public function is for allowing other scripts to use the function remotely. I.e:
Level NPC A:
PHP Code:
function onCreated() {
this.level.cat = this;
}
public function meow() {
echo("Meow");
}
Level NPC B:
PHP Code:
function onCreated() {
if (this.level.cat == NULL) {
waitfor(this, "LetCatLoad", 0.05);
}
temp.cat = this.level.cat;
temp.cat.meow();
}
A class basically pastes code/functions into an NPC, onCreated is called in the class when it's joined.