ID:146839
 
obj/door
icon = '000Matrix door.dmi'
density = 1
opacity = 1

Bumped()
var/Guess=input("What is the door's password?")
if(Guess==src.password)

src.density=0
src.opacity = 0
src.icon_state = "dooropen"
sleep(50)
src.density=1
src.opacity = 1
src.icon_state = "doorclosed"

i am trying to make a door that when you bump into it then it asks you for the password and if you get it right then it looses its density and looses its opacity.I made this but it doesnt work right, can anyone help?Note: i have already made the variables if thats what you think it is, i just didnt put them on here.
Try:

Bump(mob/M)
var/Guess=input(M,"What is the door's password?") as text

~~§~~
Tsonic112 wrote:
obj/door
icon = '000Matrix door.dmi'
density = 1
opacity = 1
var/password = ""
icon_state = "doorclosed"

Bumped(atom/movable/M)
var/Guess
if(!M || !M.client)
return
Guess = input(M, "What is the door's password?")
if(Guess==src.password)
src.density=0
src.opacity = 0
src.icon_state = "dooropen"
sleep(50)
src.density=1
src.opacity = 1
src.icon_state = "doorclosed"

Other than the incorrect indentation, it works. (Corrected version above.) You might consider mearly opening doors that have no passwords...

Also: Every Bumped() proc that I've ever used usually include some knowledge of _who_ did the bumping. And in your case: It's Mandatory! After all, who are you displaying the input() to? (In your code: usr. And if you've ever browsed these forums, you know what they do to those who use usr in a proc. ;) ) So: we change it to M. Also note that whatever is calling the Bumped() proc (usually I use atom/movable/Bump()) needs to send something for M---whatever is doing the Bumping. For example:
atom/movable/Bump(atom/O)
O.Bumped(src)
atom/proc/Bumped()

Bump() gets called on failed movement into O, and it calls O's Bumped() proc, passing src (the atom/movable that did the bumping, possibly _not_ a player, to the Bumped() proc)