I am a decent scratcher who is working on an RPG. I am trying to create a variable list for the RPG that allows an item to be picked from an item list, used, and then deleted from the list: however, I can't seem to get this to work. Could someone please make me a project that shows how I would go about doing this? Help would be highly appreciated.
Offline
Depends on what method you want to use...you could use several, but probably the easiest would be something like this:
When flag clicked:
list=(fish,cat,dog,bone,fire,gun)
forever
if key space pressed
ask "What item would you like to use? Type the item number."
broadcast (item (answer) of list)
delete item (answer) of list
end
and for your sprite, you would have a broadcast script to run when it comes, such as:
When I receive (fish)
change hunger by (-5)
say "I ate the fish! That was good!" for 4 seconds
If you have many items and don't want to use so many scripts, use a variable almost in the same way.
Offline