ID:1707404
 
(See the best response by WSHGC.)
Code:
mob
verb
Teleport_To_Hospital()
set category = "COMMANDS"
switch(input("Do you wish to teleport to the hospital?", text) in list ("Yes","No"))
if("Yes")
usr.loc = locate(44,186,1)
usr.safe = 1
if("No")
return


runtime error: undefined variable /mob/var/
proc name: Teleport To Hospital (/mob/verb/Teleport_To_Hospital)
source file: verbs.dm,37
usr: Techno (/mob)
src: Techno (/mob)
call stack:
Techno (/mob): Teleport To Hospital()

Problem description:
So, I recently used a if(prob) code and had issues getting it working. Well I got it working, but now ALL the switch(inputs aren't working. Every time one is activated it gives me that error.
Best response
Really, it just looked as if there's a few indentation errors. I tried it myself and what I put below worked fine for me.

mob

verb

Teleport_To_Hospital ( )

set category = "COMMANDS"

switch(input("Do you wish to teleport to the hospital?") in list ("Yes","No"))

if ( "Yes" )

usr.loc = locate(44,186,1)

usr.safe = 1

if ( "No" )

return

mob/var/safe = 0