ID:170622
 
I need to make a build verb that when you build it a thing pops up says locked or unlocked and if you push locked then it remembers your key and onley you can walk on it and if u push unlocked anyone can walk on it.Thanks in advance, PLZ Help me on this, i have been trying to figure this out for 2 weeks so plz help me:D
From what I understand you want something like this(Untested)-
mob/verb/Boom()//Defines a verb called Boom
var/obj/Q=new/obj/O(usr.loc)//Makes a new obj/O at the loc of usr, and puts it into a var so you can do things to it
Q.Master=usr//Sets the obj's Master var to the usr of the verb
obj/var/Master//Defines an obj var called Master
obj/O//Defines an obj called O
turf
Enter()//This is the enter proc for turfs it gets called when a movable atom tries to enter the turf
for(var/obj/O/O in src)//If there are any obj/O's in the turf's loc
if(O.Master==usr)//If the obj/O's master is the atom trying to enter
return ..()//Continue with the normal Enter()
else//If not
return 0//This does not allow the atom to enter
return ..()//If there are no obj's Os than continue normally
In response to Artekia
WHat does that do??
In response to Tsonic112
I commented it to try to help.
In response to Artekia
OK, let me refrase this, I need to make a door and i have no idea how to make it!!
In response to Tsonic112
Look up proc, icon_state, var, density, and if in the refrence.
In response to Hell Ramen
How would I make an obj and when you bump into it then it will flick an icon state and then have a density of 0.Can you just help me with that?
In response to Tsonic112
You just basically answered your own question...
In response to Hell Ramen
Can you just tell me how please!
In response to Tsonic112
Look up the Bumped() proc on the forums.

obj
Bumped()
flick("open",src)
src.density=0


obj and when you bump into it then it will flick an icon state and then have a density of 0
In response to Hell Ramen
Would this work cause I have a error and i dont know what is wrong with it...
obj
door
icon = 'door.dmi'
Bumped()
flick("open",src)
src.density=0
In response to Tsonic112
lets just say... indention error.
In response to Flame Sage
Yes, an indentation error. Otherwise, if not, what's your error?
In response to Artekia
Two things you must never do:

  • No put usr in proc. Ungh.
  • Never put a // comment right up againts the code. Put some spaces between.

    Lummox JR