Riddle of the blue eyes (idea)

This riddle kept me up all night. It is the hardest riddle I have come across. There is a real answer.

On a small island in the middle of the ocean, there lives a tribe of people. The number of people does not matter - let's say fifty. Each person in the tribe has either blue eyes or green eyes. However, there are no mirrors on this island and the ocean is too murky so the tribesmen have NO way of knowing what color their eyes are. Furthermore, the capriciousgod the islanders worship has forbidden them to reveal to each other what color eyes they have. The islanders are devout and thus far have obeyed their god's command, so none of them know what color eyes they have.

One day their god tells them that all blue eyed people must kill themselves and if they do, all the islanders will go to heaven. However, if a blue-eyed person doesn't commit suicide, or if any green eyed person commits suicide or is harmed in any way, or if, during the process, any islanders communicate in any way, all the islanders will go to hell. The islanders believe their god, and after a time, they succeed in carrying out his command. Keeping in mind that the exact number of islanders is irrelevant, how do they do it?