i can see two big problems
you have the onSelect function wrapped within the gui container, it should be outside of the onCreated function with the gui name before the event name
you still arent comparing variables properly, it should be '==', just one '=' is for assigning variables
a better way to accomplish this would be to have an array of item data, and loop through the array when building the list,
the onSelect() function already returns the index of the list item you click, which can then be used to reference the price within the array
PHP Code:
//#CLIENTSIDE
function onCreated(){
//setup item data, {name, price}
this.items = {
{"Red Sword", 100},
{"Flintlock Pistol", 500}
};
//loop through item array to build list
clearrows();
for(temp.i : thiso.items){
addrow(temp.n, temp.i[0]);
temp.n ++;
}
//invoke the select action on the default row
setselectedrow(0);
}
//select event has list index parameter, use this to obtain price from array
function Items.onSelect(temp.i){
Price.text = this.items[temp.i][1];
}
it is also worth mentioning that the parameter when building a new gui should not be passed as a string even though it would still work, its best to remove the " " quotes
you will also want to avoid using such a script within level npcs if theres going to be more than one shop, because they would conflict with eachother even if they are in a different level
the best method is to put gui scripts in a weapon, and then call a public function from the level npc script to the weapon script in order to invoke the display, and pass a parameter to identify the npc which called it