Using the in game config editor, I typed this code:
Code: Select all
level_trigger_2=[
echo "Teleporting..."
echo "Location found."
echo "Welcome home!"
sleep 5000
map Game1map2
Code: Select all
level_trigger_2=[
echo "Teleporting..."
echo "Location found."
echo "Welcome home!"
sleep 5000
map Game1map2
Code: Select all
"on_start" = [
coin = 0
horse = 0
sword = 0
food = 0
]
"level_trigger_1" = [ coin = ( + $money 10000 )
echo "You got 5 moneys."
]
"level_trigger_2" = "showgui Shopkeeper"
newgui Shopkeeper [
guitext "What will it be today?" chat
guibar
guilist [
guibutton "Food: 10 coins" [
if ( > $coin 9 ) [
coin = ( - $coin 10 )
food = ( + $food 1 )
]
]
guibar
guibutton "Sword: 150 coins" [
if ( > $coin 149 ) [
coin = ( - $coin 150 )
sword = ( + $sword 1 )
]
]
guibar
guibutton "Horse: 7050 coins" [
if ( > $money 7049 ) [
money = ( - $money 7050 )
horse = ( + $horse 1 )
]
]
]
]
newgui Inventory
guibutton "Back" "cleargui 1"
guibar
guitext ( format "You have %1 coins in your wallet." $coin )
guitext ( format "You have %1 Food." $food )
guitext ( format "You have %1 swords." $sword )
guitext ( format "You have %1 horse." $horse )
]
newgui main [
guilist [
guilist [
guibutton "Inventory" "showgui Inventory"
]
]
guibar
@main
]