Frictional Games Forum (read-only)

Full Version: Fatal Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Look at my code
void OnStart()
{
// use "ScriptArea_1" on "servunt_grunt_1" enemy => calls "MonsterFunc1"
AddUseItemCallback("", "key_tomb_2", "prison_2", "KeyOnDoor", true);

// use "key_tomb_3" on "castle_4" door => calls "KeyOnDoor"
AddUseItemCallback("", "key_tomb_3", "castle_4", "KeyOnDoor", true);
}
void MonsterFunc1(string &in asParent, string &in asChild , int alState)
{
SetEntityActive("servant_grunt_1" , true);

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_4", false, true);
RemoveItem(asItem);
PlaySoundAtEntity("", "unlock_door.snt", "castle_4", 0.0f, true);
}
I have fatal error. Unexpected end of the file. I can't understand what i did wrong. Help!
Put a } after SetEntityActive("servant_grunt_1" , true);
And I have another question
My scrip with monster worked, but now it isn't working. Why?
void MonsterFunc1(string &in asParent, string &in asChild , int alState)
{
SetEntityActive("servant_grunt_1" , true);
}

You forgot closing bracket Smile