ID:149184
 
ok i'm trying to make a verb that allows someone to make a sign and have it say what they want but i'm getting errors

mob
verb/Make_Sign()
st = input("What will you write on it?")
new /obj/sign(usr.loc)



obj/sign
icon='sign.dmi'
density=1

Click()
if (usr.gold>=100)
usr << "[st]"

thats the code and it says i have an undifined var but i defined it.

var/st

here.

anyone know how to fix this?


Alienman
mob/verb/makeasign()
var/msg = input("Whats the thing say?") as message
var/obj/sign/T
new T(usr)
T.desc = msg

obj/sign


Something like that
In response to Sariat
what do I do with the Sign obj. do i add...

obj/sign
icon='sign.dmi'
density=1

Click()
usr << "[What do I add here?]"

I tried adding msg but it said it was an undifined var.

and it was difined here...

var/msg = input("Whats the thing say?") as message


Thanks

Alienman

In response to Alienman22774
obj/sign/Click()
usr << src.desc
In response to Sariat
i'm getting a runtime error when i'm making the sign

runtime error: Cannot create objects of type null.
proc name: make a sign (/mob/verb/make_a_sign)
usr: Alienman22774 (/mob/sephiroth)
src: Alienman22774 (/mob/sephiroth)
call stack:
Alienman22774 (/mob/sephiroth): make a sign()

i have no clue how to fix that i had been playing around with it hours before i asked for help in the 1st place

Alienman
In response to Alienman22774
Ok i think your problem is this. The variable st is defined yes, but only under the obj part of the code making it undefined in areas that arent in the obj folder so:
mob
verb/Make_Sign()
var/tmp/H = input("What will you write on it?")
var/obj/sign/S=new()
S.loc=locate(usr)
S.st=H


obj/sign
icon='sign.dmi'
density=1
Click()
if (usr.gold>=100)
usr << "[st]"
var/st
O u can tell iif u need usr or src by adding a usr<<"Yay"
if u use the verb and u dont recieve said message u can change it to src no prob.