JMFStorm
Member
Posts: 205
Threads: 8
Joined: Aug 2011
Reputation:
28
|
RE: attach script to another
(12-01-2011, 07:37 PM)Ravenskull Wrote: void OnStart()
{
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
}
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door_slam", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(15.0f, true);
} <-REMOVE
{ <-REMOVE
AddUseItemCallback("", "key_1", "door_1", "open", true); <-Shouldn't this be in the "void OnStart"?
}
void open(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem("key_1");
} If this doesn't work there is still something wrong that I missed.
|
|
12-01-2011, 07:45 PM |
|