Welcome,
Guest
. Please
login
or
register
.
Home
Help
Login
Register
Kingdoms of Ahln
>
Kingdoms of Ahln
>
Admin and Development Help
>
Checking for the presence of an item class in a player's room.
Pages: [
1
]
Print
Author
Topic: Checking for the presence of an item class in a player's room. (Read 429 times)
Saffire
Citizen
Posts: 136
Checking for the presence of an item class in a player's room.
«
on:
February 08, 2009, 05:14:45 pm »
How would I go about checking for the presence of an item that belongs to a specific class in the room of the player that is inputting the command? So far I have this:
Code:
shrine = room.inventory.find("class", :Shrine)
But it's not working.
Logged
Justin
Administrator
Citizen
Posts: 189
Re: Checking for the presence of an item class in a player's room.
«
Reply #1 on:
February 08, 2009, 06:51:24 pm »
You will have to use
find_all
with those arguments, which will return an array of the matching items.
If you only need to know if the room has an item of that type, you can use
has_any?
.
Logged
Saffire
Citizen
Posts: 136
Re: Checking for the presence of an item class in a player's room.
«
Reply #2 on:
February 08, 2009, 07:41:01 pm »
Hey it worked.
Who's awesome?
You're
awesome!
Logged
Pages: [
1
]
Print
Jump to:
Please select a destination:
-----------------------------
Kingdoms of Ahln
-----------------------------
=> General
=> Development News
=> Admin and Development Help
===> Scripting
=> Bugs and Errors
=> Ideas
-----------------------------
Everything Else
-----------------------------
=> Tavern Tales
Powered by SMF 1.1.15
|
SMF © 2006-2009, Simple Machines
Terra97
design by
Bloc
Loading...