Frictional Games Forum (read-only)

Full Version: I Have A problem in Script!!! Please Help me!!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi formun i need your's help but i have a problem!!!
this script no running in amnesia. is a custom history
i have a error in amnesia (loading page") and hps no running in map!!!!!
////////////////////////////
// Run when entering map
void OnEnter()
{
{ AddUseItemCallback("", "awesomekey_1", "mansion_1", "KeyOnDoor", true);

}

void MyFunc(string &in asItem, string &in asEntity)

{ SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1");

}



////////////////////////////
// Run when leaving map
void OnLeave()
{

}





The void OnEnter() is having two '{'s
so, it should look like this:void OnEnter()
{
AddUseItemCallback("", "awesomekey_1", "mansion_1", "KeyOnDoor", true);
}


Also, your Function is named wrong, it should be "KeyOnDoor" but yours is "MyFunc", so change it
I would suggest putting the Callback inside void OnStart and you need to change void myfunc to void KeyOnDoor
Smile Use this:
Spoiler below!
////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "awesomekey_1", "mansion_1", "KeyOnDoor", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1");
}



////////////////////////////
// Run when leaving map
void OnLeave()
{

}

Tanks!!!! is great!!! my problem is gone!!!! xD
Tanks to:
[b]FinBanana[/b],[b]Unearthlybrutal,[/b][b]SilentStriker Great People!!!
[/b]
No problem Smile