ID:167137
 
This is my last question of the night, earlier today I asked how I could bump into another person and then they talk to me. But now i'm wondering how I could make it so there was two people I could bump into and they both say different things. I tried just making two of the same code:
mob/Bump(atom/A)
if(istype(A, /mob/person))
var/mob/master/N = A
N.chat(src) // and mob/Bump(atom/A)
if(istype(A, /mob/master))
var/mob/master/N = A
N.chat(src)


But for some reason, when I bump into the first dude he no longer responds... Anyway to fix this?
All you have to do is overwrite chat() for each NPC. For example:
mob/person
proc/chat(mon/M)
Shop_Keeper
chat(mob/M)
M<<"Wow! I can talk! Amazing! Do you want a donut? Ten bucks."
Beggar
chat(mob/M)
M<<"Cool! I can talk... I CAN BEG! Got a donut?"
In response to DarkCampainger
Thanks