Trouble With chat.Add()

So I’m trying to use chat.Add() when a player kills an NPC.

I’m using


 
function GAMEMODE:PlayerSpawnedNPC()

chat.Add("Hello World!")

end


Now obviously this doesn’t work, but I’m not entirely sure how to make it work. Any help would be greatly appreciated.