ID:143990
 
Code:
obj
Door
Bump(atom/O)
if(istype(O,/obj/Door))
if(password!=(null))
usr.pass = input("Password?")as text
if(usr.pass==password)
icon_state = "Open"
density = 0
opacity = 0


Problem description:
The code is not working, Im making a building game, So when a player places a Door down, It asks if he wants a pass for it, If he does, enter the pas, And anyone who knows the password can enter, But it is not working, I keep getting 2 errors and 2 warnings:
Doors.dm:56:error:usr.pass:undefined var
Doors.dm:57:error:usr.pass:undefined var
Doors.dm:54:if :warning: if statement has no effect
Doors.dm:57:if :warning: if statement has no effect

Please help!

The Building Part of The Door Just Incase Its The Problem
mob
Build
verb
Door()
set name = "Door"
set category = "Build"
if(usr.build == 0)
var/a = new/obj/Door(usr.loc)
a:owner = "[src.key]"
else
usr << "You can't build here"
return
input("Enter Password","Password")as password
if(password)
usr<<"You Locked This Door"
O.pass.
In response to Xx Dark Wizard xX
Were do i add that in my code?
In response to BEVAN
BEVAN wrote:
Were do i add that in my code?

You replace the usr.pass, I believe. I dunno. I'm just trying to add to what he's saying.
In response to RedlineM203
Nope...
Just get these agen..


Doors.dm:56:error:O.pass:undefined var
Doors.dm:57:error:O.pass:undefined var
Doors.dm:54:if :warning: if statement has no effect
Doors.dm:57:if :warning: if statement has no effect
In response to BEVAN
Learn to code on your own.
In response to Kaioken
-.- I can code, How do you think i started with the code? Im asking for some help on a code problem, That's what the Code problem section is for, Not for you to go round telling people to "Learn to code" When they can.
In response to BEVAN
mob
verb
door()
var/obj/door/D = new(usr.loc)
D.pass = input("Pass") as password
obj
door
Bump(mob/M)
if(M.client)
var/thepass = input(M,"whats the pass")as password
if(src.pass == thepass)
src.density = 0
sleep(5)
src.density = 1