turf/var
x1
y1
z1
password
key
turf/lock
doorkeypass
Enter()
if(usr.key == "[src.key]")
usr.loc = locate(src.x1,src.y1,src.z1)
else
var/passwords = input("Enter Password")as num
if(passwords == src.password)
usr.loc = locate(src.x1,src.y1,src.z1)
I know this makes a door have a password but im not entirely sure i understand it =/ or how to use it, and im not the type to just copy and paste something so could someone help me understand this snippet? Thanks.
I rewrote that a little. You shouldn't use usr.
Here is what it does:
Once someone walks up to it, if will do the following:
If the person's key is the same as what the turf's 'key' variable is, the player will be transported to (x1,y1,z1). Otherwise, they will be asked for a password. If it matches with the turf's 'password' variable, the player will be teleported in the same way.