need help with script for horror game

hey guys I have been using unity for quite some time now and am trying to make a horror game based on confusion. so one script I need for this to work is a script that what it basically does is when the enemy hits you a instance of an enemy flashes all around you (kinda like he is teleporting all around you really fast then dissipates. if you have any ideas or need clarification on how the idea i had works please post i would really appreciate some help thanks :wink:

var playerPosition : Vector3;
var attacked : boolean;
var monster : GameObject;

function Update(){
    if(attacked){ //if the player is being attacked
        playerPosition = transform.position; //Get the position of the player
        Attacked(); // Call the attacked function
    }
}
function Attacked(){
    for(var i : int = 0; i < 4; i++){ // do the loop four times
        monster.transform.position.x = playerPosition.x +2; // move the monster to the players x axis
        yield WaitForSeconds(0.5); // wait for half a second
        monster.transform.position.z = playerPosition.z +2; //move the monster to the players Z axis
    }
}

Something like that might work?

thanks a ton I will notify you if it works the way i hope it does

RotateAround would be a better solution…