ID:175205
 
Im trying to make it so that only the owner and the people he allows can enter his house. In my coding I'm making it so the owner types in the name of the person he wants to be able to enter his house then his/her name gets put in a list, But I get a runtime error when I try to test it out.

Here's the error(The error happens after I enter the name):
runtime error: undefined variable /mob/var/Lisenced
proc name: Lisence (/obj/house/Door/verb/Lisence)
usr: Koolguy900095 (/mob)
src: Koolguy900095 (/mob)
call stack:
Koolguy900095 (/mob): Lisence()

And here is the coding im using:

obj
house
Door
var/list/Lisenced = list()
density = 1
icon = 'Turfs.dmi'
icon_state = "Door"
verb
Lisence()
var/lisencing = input("Enter the name of the person you would like to lisence.","Lisence")
lisencing += Lisenced


Can you tell me whats wrong and how I can fix it? Thanks!

PS: I just realised it says undefined variable, but it is defined...:(
You have it backwards. It should be Liscenced += liscencing.
In response to Garthor
Oh yeah I fixed that in my coding forgot to edit here..but it still deosnt work...
Well, I'm not sure if this will work, but maybe...
obj
house
Door
var/list/Lisenced = list()
density = 1
icon = 'Turfs.dmi'
icon_state = "Door"
verb
Lisence(mob/M as mob in world)
lisencing += M.key
In response to Dragon of Ice
I dont want the key because then if they make a new character they can still enter
In response to Koolguy900095
You could use their character name as well as their key.
Koolguy900095 wrote:
Im trying to make it so that only the owner and the people he allows can enter his house. In my coding I'm making it so the owner types in the name of the person he wants to be able to enter his house then his/her name gets put in a list, But I get a runtime error when I try to test it out.

Here's the error(The error happens after I enter the name):
runtime error: undefined variable /mob/var/Lisenced
proc name: Lisence (/obj/house/Door/verb/Lisence)
usr: Koolguy900095 (/mob)
src: Koolguy900095 (/mob)
call stack:
Koolguy900095 (/mob): Lisence()

And here is the coding im using:

obj
house
Door
var/list/Lisenced = list()
density = 1
icon = 'Turfs.dmi'
icon_state = "Door"
verb
Lisence()
var/lisencing = input("Enter the name of the person you would like to lisence.","Lisence")
lisencing += Lisenced


Can you tell me whats wrong and how I can fix it? Thanks!

PS: I just realised it says undefined variable, but it is defined...:(

DUH! It just hit me! Your var is messed. should be:
var/lisencing = input("Enter the name of the person you would like to lisence.","Lisence") as text

not sure if you fixed this yet...
In response to Airjoe
that wasnt the problem........But thanks anyway and I walready fixed it