ID:144787
 
Code:
obj
doorg
icon = 'door1.dmi'
icon_state="closed"
var/pword = "Sivnargo" //Gives the door a password
icon_state = "closing"
density = 1 //Make door solid
opacity = 1 //Make it so you can't see through it
proc/tryit(var/mob/m,var/obj/doorg/O) //Procedure for asking for the password
set background = 1
var/a = input("This is guarded by the Password Charm. Enter Password.")as text //Asks for the password
if(O.pword == "[a]")
//If the password you tried is the password
call(/proc/openg(O) //It calls the procedure for making the door open
return 0
else //If the password was wrong
m << "<B><font color=red>:: Incorrect Password. Access Denied. ::</b></I>"
return 0


mob
Bump(atom/O) //Calls this when a person bumps into something
if(istype(O,/obj/doorg)) //Checks to see if it is a door
call(/obj/doorg/proc/tryit)(usr,O) //Calls the process for asking for the password


proc/openg(obj/doorg/O)
set background = 1
O.density = 0 //Allows you to walk through it
O.opacity = 0 //Allows you to see past it
flick("opening",O) //Makes the door appear to be opening
O.icon_state = "dooropen" //Door stays open
usr <<"<b><font color=green>:: Password Accepted. Access Granted :: </font>"
sleep(40) //Waits a while before shutting the door
flick("doorshut",O)
O.icon_state = "closed"
O.density = 1 //Makes it solid again
O.opacity = 1 //Now you can't see inside it


Problem description:Hogwarts Wizard Trainers.dm:708:error: return: missing comma ',' or right-paren ')'
Hogwarts Wizard Trainers.dm:708:error: expected syntax: call([Object,]Proc)(Args)
Hogwarts Wizard Trainers.dm:709:warning: empty 'else' clause
Hogwarts Wizard Trainers.dm:732:error: return: missing comma ',' or right-paren ')'
Hogwarts Wizard Trainers.dm:732:error: expected syntax: call([Object,]Proc)(Args)

Hogwarts Wizard Trainers.dmb - 4 errors, 1 warning (double-click on an error to jump to it)

ok i think you can figure out what is wrong from all that, ive asked a few of my coder friends but they didnt know what was wrong, the problems are on the return 0's and the else, plus it wont call the bump/password thing.


When you call open(), you're missing a ). Try call(/proc/openg)(O).