ID:138938
 
Code:
The code where the item should be added to the inventory
    Player
Gun {icon_state="rei"}
obj/SkillButtons/ReiGunButton


The object that should be bought
obj/SkillButtons
ReiGunButton
icon='icons.dmi'
icon_state="rei"
Click()
usr.Rei_Blast()

Problem description:
compiles with no errors lets me buy the skill then poof nothing ohh I have also tried the following
src.contents += new/obj/SkillButtons/ReiGunButton
usr.contents += new/obj/SkillButtons/ReiGunButton

and those brought up alot of errors
Try this:

new/obj/SkillButtons/ReiGunButton(src)


Or

var/obj/R = new /obj/SkillButtons/ReiGunButton
R.loc = usr


- Hashir
In response to Hashir
Hashir wrote:
Try this:

> new/obj/SkillButtons/ReiGunButton(src)
>

Or

> var/obj/R = new /obj/SkillButtons/ReiGunButton
> R.loc = usr
>

- Hashir

Just tried it and it worked with this var/obj/R = new /obj/SkillButtons/ReiGunButton but it did not add the card to my contents
In response to Wrath69
I dont know if this will help but here is the rest of the code governing the skill tree

skill
Click()
if(usr.skillpoints<=0)
usr << "You have no skill points to spend."
return
if(usr.busy)return
usr.busy=TRUE

if(reqskill)

if(!(src in usr.skills))

if(!(locate(reqskill) in usr.skills))

var/skill/req=new reqskill
usr << "You must first get \"[req]\"[reqskilllvl>1 ? " to the level [reqskilllvl]" : ""]."
del req
usr.busy=FALSE
return
else

var/tskill=locate(reqskill) in usr.skills
if(tskill && usr.skills[tskill]<reqskilllvl)

var/skill/req=new reqskill
usr << "You must first get \"[req]\"[reqskilllvl>1 ? " to the level [reqskilllvl]" : ""]."
del req
usr.busy=FALSE
return

if(!(locate(type) in usr.skills))
//just checkin'
if(alert(usr,"Are you sure you want to buy [src]?","[src]","Yes","No")=="Yes")

usr.skills += src
usr.skills[src]=1
usr.skillpoints-=skillcost
usr.client.load_tree(usr.class)
usr << "You learned [src]!"
else
//verification of the skills existance
var/skill/x=locate(type) in usr.skills
if(!x)usr << "Odd issue here.."
if(usr.skills[x]>=x.maxlevel)
usr << "[src] is currently at level [maxlevel], the maximum level."
usr.busy=FALSE
return

if(alert(usr,"Are you sure you want to raise [src]'s level to [curlevel+1]?","[src]","Yes","No")=="Yes")

usr.skills[x]++
usr.skillpoints-=skillcost
usr.client.load_tree(usr.class)
//reload the tree afterwards, so you can visually see the changes
usr.busy=FALSE

icon='icons.dmi'

New(newloc)
if(istext(newloc))
screen_loc = newloc
//thanks again to lummox

available/icon_state="available"
//blue
unbuyable/icon_state="unbuyable"
//red
completed/icon_state="completed"
//green
arrow
icon_state="arrow"
New(loc,dir)
dir=dir

parent_type=/obj