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
Script Help Trigger Sounds not working
Xallikk Offline
Junior Member

Posts: 35
Threads: 7
Joined: Jun 2016
Reputation: 0
#1
Trigger Sounds not working

I'm trying to make it so when the player walks into an area, a sound plays but it's not working. Here's the script I'm using:

void OnStart()
{

AddUseItemCallback("", "Key", "Door", "UseKeyOnDoor", true);
AddUseItemCallback("OpenDoor", "LevelKey1", "LevelDoor1", "UseKeyOnLevelDoor", true);
AddEntityCollideCallback("Player", "OpenScare", "SoundCheck", false, 1);
}



void SoundCheck(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("sound", "notice.snt", "OpenScare", 1.0f, false);
}

void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door.snt", "asEntity", 0, false);
RemoveItem(asItem);
}

void UseKeyOnLevelDoor(string &in asItem, string &in asEntity)
{

SetLevelDoorLocked(asEntity, false);
PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
RemoveItem(asItem);
}
void OnLeave()
{

}

Also, is there anything I have to do with the area besides the name?

The ones at the front always die first...
06-04-2016, 08:05 PM
Find


Messages In This Thread
Trigger Sounds not working - by Xallikk - 06-04-2016, 08:05 PM
RE: Trigger Sounds not working - by Slanderous - 06-04-2016, 09:31 PM
RE: Trigger Sounds not working - by Xallikk - 06-04-2016, 09:43 PM
RE: Trigger Sounds not working - by Slanderous - 06-04-2016, 10:44 PM
RE: Trigger Sounds not working - by Xallikk - 06-04-2016, 10:52 PM
RE: Trigger Sounds not working - by Slanderous - 06-04-2016, 10:55 PM
RE: Trigger Sounds not working - by Xallikk - 06-04-2016, 10:58 PM
RE: Trigger Sounds not working - by Slanderous - 06-04-2016, 11:04 PM
RE: Trigger Sounds not working - by Xallikk - 06-04-2016, 11:06 PM
RE: Trigger Sounds not working - by Slanderous - 06-04-2016, 11:08 PM
RE: Trigger Sounds not working - by Xallikk - 06-04-2016, 11:10 PM
RE: Trigger Sounds not working - by Slanderous - 06-05-2016, 12:55 AM
RE: Trigger Sounds not working - by Xallikk - 06-05-2016, 12:59 AM
RE: Trigger Sounds not working - by Daemian - 06-05-2016, 04:32 AM
RE: Trigger Sounds not working - by Xallikk - 06-05-2016, 04:36 AM
RE: Trigger Sounds not working - by Slanderous - 06-05-2016, 10:58 AM



Users browsing this thread: 2 Guest(s)