ID:178287
 
this is a simple little thing but I still somehow never managed to learn this. All I need to know is how to move the 2 objects under buy into the users contents

mob/npc/bizinessman
icon = 'characters.dmi'
icon_state = "biznisman"
name = "Biznis Boy"
Click()
for(src in oview(1))
switch(alert("What would you like to do","Biziness mans shop","Buy","Sell","Nothing"))
if("Nothing")
return
if("Buy")
var/buy = input("What would you like to buy","Biziness mans shop") in list("Boom Box","Done")
switch(buy)
if("Boom Box")
new /obj/music/boombox()
new /obj/music/boombox/sample_CD()
var/obj/music/boombox/S
S.samplecd = 1
if("Done")
return

thats all
Little Kid
new /obj/music/boombox()
new /obj/music/boombox/sample_CD()
var/obj/music/boombox/S
S.samplecd = 1
if("Done")
return

It should be var/obj/music/boombox/S = new(usr) . Do the same thing for the next line. Then take out the third line var/obj/music/boombox/S . That should be it.
In response to Garthor
Garthor wrote:


It should be var/obj/music/boombox/S = new(usr) . Do the same thing for the next line. Then take out the third line var/obj/music/boombox/S . That should be it.

now I get this error:
Undefined var

on this line of code(the line that is all capitalized)

var/buy = input("What would you like to buy","Biziness mans shop") in list("Boom Box","Done")
switch(buy)
if("Boom Box")
var/obj/music/boombox/S = new(usr)
OBJ/MUSIC/BOOMBOX/SAMPLE_CD = NEW(USR)
S.samplecd = 1
if("Done")
return
In response to LittleKid15
you need a var/ before it, and a variable to refer it by after it (such as CD or something). If you don't want to edit it in this proc/verb/whatever, just leave it at   new /obj/boombox/sample_CD(usr)   or whatever.