The Basilisk never attacked anyone in the castle, but since its eyes are deadly too, anybody who saw it directly would have died. However, every single person who was petrified by it saw it through something else, as a reflection, which is why nobody died from looking at its eyes.