ID:177008
 
How do you only allow a verb to work if the usr is in a certain area/turf and he/she has a certain object? Here is my code so far:
Till()
set src in view(0)
if(usr.contents)
tilled = 1
icon_state= "soil"
else usr << "You don't have a hoe!"

Hazman wrote:
How do you only allow a verb to work if the usr is in a certain area/turf and he/she has a certain object? Here is my code so far:
Till()
set src in view(0)
if(usr.contents)
tilled = 1
icon_state= "soil"
else usr << "You don't have a hoe!"

What you'll need is if(locate(/obj/hoe) in usr).

Lummox JR
In response to Lummox JR
Or, you just give the verb to obj/hoe. And then, put in if(usr.loc.tillable), then give all tillable turfs a tillable variable, and set it to 1 for tillable turfs. Is tillable a word?
In response to Garthor
Thanks to both of you!