Results 1 to 2 of 2

Thread: Delete object after specified time

  1. #1

    Delete object after specified time

    Probably something quite simple, but i'm not too sure.

    I know that there is deleteVehicle which gets rid of an object, but is there a way to do it after a specified time, i.e. getting rid of a sound after 15 minutes.

    So that it doesn't go on through the entire mission and get incredibly boring?

    Cheers, Morts


    One In. All In.

  2. #2
    Master Sergeant sxp2high's Avatar
    Join Date
    Jul 16 2009
    Location
    nearestLocation [(getPos player), "nameCity"];
    Posts
    605
    Sound or object?

    However, the sleep, while, isNil commands are your friends for this.

    Examples:

    For a sound:
    PHP Code:
    [] spawn {
        
    sleep 900;
        
    StopSound true;
    };

    while {
    isNil "StopSound"} do {
        
    playSound "YourSound";
        
    sleep 30// Repeat sound
    }; 

    For an object (put this into its init line):
    PHP Code:
    nul this spawn sleep 900deleteVehicle _this; }; 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •