function onChat ( _, messageType ) if isPedDead(source) and messageType == 0 and not chat then chat = true elseif ( messageType == 0 and not chat ) then cancelEvent ( ) end end addEventHandler ( "onPlayerChat", root, onChat )