ID:2015385
 
(See the best response by Nadrew.)
Code:
mob/verb/Give_Required_Perk(mob/M in world)
var/obj/perk/buy = input("Which Perk?") as null | anything in perk
contents += buy


Problem description:runtime error: cannot append to list
proc name: Give Required Perk (/mob/verb/Give_Required_Perk)
source file: test3.dm,60
usr: (src)
src: Tavren (/mob)
src.loc: null
call stack:
Tavren (/mob): Give Required Perk(Tavren (/mob))

Line 60 is contents += buy


'buy' probably isn't an object. What does the 'perk' list contain?
The Perk list contains this:
var perk[] = list(
"No Requirement" = "No Requirement",
"Anger" = "Anger",
"Berserker" = "Berserker",
"Brute" = "Brute"
)
Perk system is simple to write.. you don't need any objs for it you can just use text. Just look

var/list/PerksList=list("Berserk","Martyrdom","Skavanger")//This is list of all perks you can add
mob/var/list/Perks=list()//Your perks
mob/proc/HasPerk(var/Perk)//Simple proc fo check, do you has perk?
for(var/v in src.Perks)
if(v==Perk) return 1
else return 0
mob/verb/AddPerk(var/mob/M in world)//And this is simple prc for adding this perk.
var/NewPerk=input("Which Perk?") as null | anything in PerksList//Now we create a new var and set it new state(perk name)
if(M.HasPerk(NewPerk)) return//if you has perk this proc stop
M.Perks.Add(NewPerk)//Add new perk for list
M<<"<b><font color=red>Added new perk {[NewPerk]}"//Cool text

for example
mob/verb/Attack(var/mob/M)
var/dmg=round(src.str-M.Def)
if(HasPerk("Berserk")) dmg*2 // if we has Berserk perk, dmg rise 2x
M.HP-dmg
<dm>
Best response
While the above system is probably more ideal for your needs, I'll explain the issue you had anyways.

You're trying to add a string to the contents list, the contents list can only have other atoms within it.

Your perk list would need to be a list of objects, or typepaths to work as you'd want using your original system.

var/list/perks = list("Something" = /obj/perk/Something,"Else"=/obj/perk/Else)

// ... elsewhere in your code

var/selected_perk = input("Select a perk")as null|anything in perks

if(isnull(selected_perk)) return
var/obj/perk/new_perk = new perks[selected_perk]
contents += new_perk
Is there a way when a player logs on they automaticly have a perk? Like /obj/perk/No_Requirement. That way when a player wants to buy a perk with no requirement they can.
In response to Flameguru
Flameguru wrote:
Is there a way when a player logs on they automaticly have a perk? Like /obj/perk/No_Requirement. That way when a player wants to buy a perk with no requirement they can.

Look into the Login proc. Very basic stuff.