You don't even need a check like what you have, makes almost no sense to have it that way either. This is the gist of what you should be aiming for:
PHP Code:
function onPlayerEnters() {
if (players.size() == 1) {
if (this.rock_is_alive) {
setRockToFullHealth();
}
}
}
function onRockDestroyed() {
// Set's Timer to Timeout in 10 Seconds
setTimer(10);
}
function onTimeout() {
respawnRock();
}
function respawnRock() {
// Return rock back to normal
}
Obviously the script won't work by just copy and pasting it in, you're going have to figure that part out on your own!