var/marcielle
marcielle = list(0="How are you today?",1="The weather has been so eratic lately don't you think?",2="My husband, The Elder, Has been extremely busy lately with problems showing up all over town!")
Click()
var/x = rand(0,2)
src<< "[marcielle[x]]"
Problem description:I have been trying to make it so when an npc is clicked it runs through a list and randomly chooses a response but i keep gettin a runtime error: cannot read from list
runtime error: cannot read from list
proc name: Click (/mob/NPC/Marcielle/Click)
usr: the adfasdf (/mob/Player)
src: Marcielle (/mob/NPC/Marcielle)
usr.loc: the floor1 (40,14,1) (/turf/floor1)
src.loc: the floor1 (40,15,1) (/turf/floor1)
call stack:
Marcielle (/mob/NPC/Marcielle): Click(the floor1 (40,15,1) (/turf/floor1), "mapwindow.map", "icon-x=16;icon-y=19;left=1;scr...")
You can use pick() to pick a random item from the list.