RE: attach script to another
Hey,
no there is no error if i try to start the game - ingame it simply sais that " can not use item on this object" if i try to use the key on the door.
______________________________________________________________________________________
This is my whole used modified sript with the removed brackets
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);
AddUseItemCallback("", "key_1", "door_1", "open", true);
}
void open(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem("key_1");
}
|