I've been trying to make a code that limits how many items you may have but none works, so can someone help me
Thanks
~2k
Copyright © 2024 BYOND Software.
All rights reserved.
ID:178548
Apr 28 2002, 6:50 am
|
|
I've been trying to make a code that limits how many items you may have but none works, so can someone help me
Thanks ~2k |
In response to Foomer
|
|
thanks
|
<code>mob/var/max_items = 5 mob/Enter() if(src.contents.len > max_items) return 0 else return 1</code>
Just check to see if the player's contents length is over a certain point, and if it is don't let them add anything else to their contents. You'll also want to make any Get() actions, have an alternative "You can't get that message!" to make it look right, like this:
<code>obj/Get() if(Move(usr)) usr << "You got it!" else usr << "You don't got it!"</code>