Your best bet would be to do something like this:
PHP Code:
function onCreated() {
this.items = {
{"Item Name", "Description", "Price"}
};
this.join("shopkeeper");
}
//#CLIENTSIDE
function onCreated() {
this.items = {
{"Item Name", "Description", "Price"}
};
}
It's not very DRY, but transferring data from the server-side to the client-side in a level npc can be a un-needed pain in the ass. It'll be more instant this way anyway.
Then in your shopkeeper class just process the this.items array and create the list you need. Also on the server-side verify their purchase against the server-side items array.