1. This forum is ARCHIVED! Visit the new Cloud Sixteen forums, codename Eden, at https://eden.cloudsixteen.com. These forums will remain archived for a few months before being closed down, so try to encourage plugin developers to begin moving their content across to the new forums.
Dismiss Notice
Hi Guest, you need a Steam account to register and post on these forums. Login with Steam at the top of the forums to get started!
Dismiss Notice
Hi Guest, do you want to buy HL2RP or another Clockwork schema? Visit the Cloud Sixteen Store to get started!

Looping Sounds when Switched Characters

Discussion in 'Discussion' started by Sniping Hazard, May 15, 2013.

  1. Hello Cloud Sixteen, I attempted to create a cremator faction for HL2RP with an emitsound loop similar to the scanner but when players change characters they still attain the loop unless they exit the game or restart the soundscape. Any possible way I can remedy this problem?
     
  2. Post the code for the loop.
     
  3. To encourage you, let me just state that a Cremator faction is one of the major things that I've been outright yearning to see within a HL2rp server. Code it well, brother.
     
  4. if (player:GetFaction() == FACTION_CREMATOR) then
    if (!player.nextCrematorSound or curTime >= player.nextCrematorSound) then
    player.nextCrematorSound = curTime + 6;

    player:EmitSound("npc/cremator/amb_loop.wav");
    end;
    end;

    This is the code for the loop.
     
  5. It loops because the sound file was made to loop.

    That's why it says 'loop', lol.
     
  6. Arbiter329

    Arbiter329 Owner of Arc-Factory Roleplay

    This might fix it:

    Code:
    local CrematerSound = Sound(npc/cremator/amb_loop.wav");
    local CrematerLoop = CreateSound(player, CrematerSound)
    	if (player:GetFaction() == FACTION_CREMATOR) then
    		CrematerLoop:Play()
    	else
    		CrematerLoop:Stop()
    	end;
    
     
  7. Professorial Mister Man

    Professorial Mister Man I don't know what I'm doing.

    Any chance you wanna post the entire faction or the addon used to get the model?
     

Previous Readers (Total: 0)