The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PlaySound
nerdboyxxx Offline
Junior Member

Posts: 11
Threads: 5
Joined: Sep 2010
Reputation: 0
#1
PlaySound

Hello,

Below is the code I am using. I am trying to make a sound play when the player makes contact with a certain area. When the player makes contact with this area, the sound will play from the location of another entity (in this case another script area).

Below is the code I am currently using. I have been reading through the tutorials and teaching myself as I go, so far it has gone well however I am stuck at the moment. I can't see where I am going wrong at all.

void OnStart()
     {
     AddTimer("Timer_1", 2, "MonsterSpawn");
     AddEntityCollideCallback("player", "Child_Cry_1", "Collide_Area", true, 1);
    
      if(ScriptDebugOn())
     {
        GiveItemFromFile("lantern", "lantern.ent");

        for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
     }
    
     }
    
     void Collide_Area(string &in asParent, string &in asChild, int alState)
     {
     PlaySoundAtEntity("BabyCry", "scare_Baby_Cry.snt", "child_cry_scare", 0, false);
     }

If you could help fix up my script and explain where I went wrong I would be very grateful.

Thanks for all the help Smile
(This post was last modified: 12-14-2010, 09:54 AM by nerdboyxxx.)
12-14-2010, 05:22 AM
Find


Messages In This Thread
PlaySound - by nerdboyxxx - 12-14-2010, 05:22 AM
RE: PlaySound - by Frontcannon - 12-14-2010, 05:42 PM
RE: PlaySound - by nerdboyxxx - 12-14-2010, 10:59 PM
RE: PlaySound - by Frontcannon - 12-14-2010, 11:34 PM
RE: PlaySound - by nerdboyxxx - 12-15-2010, 12:11 AM
RE: PlaySound - by nerdboyxxx - 12-15-2010, 03:09 AM



Users browsing this thread: 1 Guest(s)