ID:268509
 
Thanks for the help... ;O
Something, for example...
EXAMPLE:
I want it so if "Jimmy" has a "Pie Key"(in his contents), he can enter the "Pie Shop".
_>
<_<
Bad example. I like pie...
Hell Ramen wrote:
Thanks for the help... ;O
Something, for example...
EXAMPLE:
I want it so if "Jimmy" has a "Pie Key"(in his contents), he can enter the "Pie Shop".
_>
<_<
Bad example. I like pie...

Use locate() and Enter(). Read about them in the help as well, but here's a quick example:

turf/door/pieshop
Enter(mob/M)
if(locate(/obj/keys/pie) in M.contents)
return ..()
else
M << "You need a pie key to enter."
return 0


/Gazoot
In response to Gazoot
    Inn_Door
icon = 'Door.dmi'
icon_state = "closed"
density = 1
Click(mob/M)
if(src in oview(usr,1))
if(locate(/obj/Inn_Key) in M.contents)
icon_state = "open" density = 0
sleep(15)
density = 1
icon_state = "closed"
else
M << "You don't have the correct key!"

_> Thanks Fint for the door code...
And, thank you for helping... but it doesn't quite work... x_X
I also tried Enter.
Didn't work either... =/
Well, that's what I have...
Thanks, for helping so far...
In response to Hell Ramen
Hell Ramen wrote:
_> Thanks Fint for the door code...
And, thank you for helping... but it doesn't quite work... x_X
I also tried Enter.
Didn't work either... =/
Well, that's what I have...
Thanks, for helping so far...

No problem! Ok, if you read the help for Click(), you'll see that the argument to it is what location the door is in, not the mob that clicked the door. So this is one of the few places where you should use usr. Remove mob/M from Click(mob/M), and replace M inside the proc with usr, and I think it should work.


/Gazoot
In response to Gazoot
    Inn_Door
icon = 'Door.dmi'
icon_state = "closed"
density = 1
Click(mob/usr)
if(src in oview(usr,1))
if(locate(/obj/Inn_Key) in usr.contents)
icon_state = "open"
density = 0 sleep(15)
density = 1
icon_state = "closed"
else
usr << "You don't have the correct key"

Meh, I'm a nub, I'll try to fix it myself... x_X Seeing as I can't understand you guys.
In response to Hell Ramen
just do Click().
--Goz
In response to Hell Ramen
    Inn_Door
icon = 'Door.dmi'
icon_state = "closed"
density = 1
Click()
if(src in oview(usr,1))
if(locate(/obj/Inn_Key) in usr.contents)
icon_state = "open"
density = 0
sleep(15)
density = 1
icon_state = "closed"
else
usr << "You don't have the correct key"
In response to Goz
Goz wrote:
just do Click().
--Goz
Thanks Goz... :P