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 No sound playing in script area
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#15
RE: No sound playing in script area

You have no function for the script area.

You only have a function for unlocking doors. And in that, you put the sound 25_strain_wood, which is exactly what you told it to.

If you want something to happen, when you collide with a script area, you need to make a function, so that something can actually happen.

What you want is both to have a function for the door and for the area. Looks like this:
PHP Code: (Select All)
void OnStart()


AddEntityCollideCallback("Player""Ljud""start"true1);
AddUseItemCallback("""Key""Door""UseKeyOnDoor"true);
AddUseItemCallback("""Nyckel""Rumpa""UseKeyOnDoor"true);
AddUseItemCallback("""Tillskåp""Skåp""UseKeyOnDoor"true);
}

void UseKeyOnDoor(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked(asEntityfalsetrue);
PlaySoundAtEntity("""Unlock_door.snt"asEntity10false);
RemoveItem(asItem);
}

void start(string &in asParentstring &in asChildint alState)
{
PlaySoundAtEntity("""25_strain_wood.snt""Player"0.0ffalse);


Also, can I just compliment your unlock-door-script? It looks very nice, and if you made that yourself, you already know a lot...

Trying is the first step to success.
(This post was last modified: 10-08-2014, 07:11 AM by FlawlessHappiness.)
10-08-2014, 07:10 AM
Find


Messages In This Thread
No sound playing in script area - by LDOriginal - 10-07-2014, 07:03 PM
RE: No sound playing in script area - by Neelke - 10-07-2014, 07:43 PM
RE: No sound playing in script area - by Neelke - 10-07-2014, 07:59 PM
RE: No sound playing in script area - by Neelke - 10-07-2014, 08:10 PM
RE: No sound playing in script area - by FlawlessHappiness - 10-08-2014, 07:10 AM



Users browsing this thread: 1 Guest(s)