Whats wrong with this Script ?
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "key_tomb_1", "mansion_1", "UsedKeyOnDoor", true);
SetEntityCallbackFunc("ITEM", "OnPickup");
}
void UsedKeyOnDoor(string &in asitem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("key-tomb_1");
void OnPickup(string &in asEntity, string &in type)
{
PlaySoundAtEntity("", "react_pant.snt", "Player", 0, false);
PlaySoundAtEntity("", "00_faint.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
SetEntityActive("servant_grunt_1", true);
}
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{