How could i make it so when you go through a door that you need a key for and you have it,How could i make the key get deleted from the usr inventory once you use it
Thanx
ID:179584
Dec 1 2001, 3:47 pm
|
|
Greg wrote:
How could i make it so when you go through a door that you need a key for and you have it,How could i make the key get deleted from the usr inventory once you use it Try this: turf/keydoor This uses keys of various colors, so you could have a red door with a red key, etc. It's actually easier to check for a specific key, but this way is more common to lots of games. The above code is untested; I've never messed with modifying turfs at runtime before, so you might want to try it and tweak it as necessary. Lummox JR |
In response to Lummox JR
|
|
Enter(M) I got a question, when your defining the mob/M and using it as Enter (M), where are you defining this? Is it a global path? or something like mob/M, obj/O, turf/T, area/A??? LJR |
In response to LordJR
|
|
LordJR wrote:
Enter(M) He didn't define it as mob, but it was a quick snippet to demonstrate the concept. You would probably want to make sure it's a mob, but since the only other thing that could ever trigger Enter() is an obj it wouldn't be much of a problem. Unless of course some clever adventurer stuffs the key in a bag and throws the bag through the doorway to open it from a distance. ;) Is it a global path? No, these aren't global defaults, but they have become an unofficial tradition in BYOND snippets. :) |
Find the key in the inventory (read back on how to find an item in the inventory), delete it, and let them in.