ID:270035
 
Hi, in a game that I am making I need help, the problem is Moving items between statpanels. Well when you buy a item from a shopkeeper it appears in your "Pack" Statpanel from there you can click it again so you can move it to the "Deck" Statpanel, in the "Deck" Stat panel is where you can use that certain item. How would I be able to do this? I have tryed and my code would not work. Help!
mob 
var
contentsA
contentsB
Stat()
statpanel("Inventory")
stat(usr.contents)
statpanel("Pack")
stat(usr.contentsA)
statpanel("Deck")
stat(usr.contentsB)


Edited...
Kiyo Takamine wrote:
Hi, in a game that I am making I need help, the problem is Moving items between statpanels. Well when you buy a item from a shopkeeper it appears in your "Pack" Statpanel from there you can click it again so you can move it to the "Deck" Statpanel, in the "Deck" Stat panel is where you can use that certain item. How would I be able to do this? I have tryed and my code would not work. Help!
> mob 
> var
> contentsA
> contentsB
> Stat()
> statpanel("Inventory")
> stat(usr.contents)
> statpanel("Pack")
> stat(usr.contentsA)
> statpanel("Deck")
> stat(usr.contentsB)
>

Edited...

How come it doesn't add it to the pack and deck?
mob 
var
contentsA
contentsB
Stat()
statpanel("Inventory")
stat(usr.contents)
statpanel("Pack")
stat(usr.contentsA)
statpanel("Deck")
stat(usr.contentsB)
/////////////////////////////Items//////////////////////////////////
obj/shopkeeper
icon = 'o.dmi'
icon_state = "o"
density = 1
verb/Buy() //the verb
set src in oview(1) //pops up if shop keeper is 1 block away
var/Buying = input("[src]: Wanna see my stuff?")in list("C (100z)","Cancel")
if(Buying == "C (100z)")
if(usr.zenny >= 100)
usr.zenny -= 100
new/obj/C(usr.contentsA)
usr <<"Please come again!"
verb/Sell(var/obj/O in usr)//the Sell verb, it lets you pick an object from your inv
set src in oview(1) //if src is atleast 1 block away
switch(alert("[src]: Are you sure you want to sell [O] for [O.price] Zenny?","Selling","Yes","No")) //pop up with the buttons Yes and No
if("Yes") //if you pressed Yes
usr <<"Please come again!"
usr.zenny += O.price
del(O) //deletes the object
obj
icon = 'B.dmi'
C
icon_state = "C"
Click()
new/obj/C(usr.contentsB)
view() << "[usr] used C."
view() << "[usr]'s C does 40 Damage"
price = 100<dm>
In response to Kiyo Takamine
You can't create something inside a list as if it were a location (other than contents, because it's a special list). You have to add it in them.

usr.contentsA += new /obj/C ()


~~> Unknown Person