Frictional Games Forum (read-only)

Full Version: Problem With Unlock Level Door
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi.
I have a big problem which I can not find a solution ... So here is the script :
Quote:void UnlockNextLevel(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("NextLevel", false, true);
PlaySoundAtEntity("", "unlock_door", "NextLevel", 0, false);
RemoveItem("SecondLevel");
}
void OnStart()
{
AddUseItemCallback("", "SecondLevel", "NextLevel", "UnlockNextLevel", true);
}
The Key : http://img15.hostingpics.net/pics/131812481.png
The Door : http://img15.hostingpics.net/pics/468589242.png
What wrong ???? I really look everywhere...

Help needed Sad
there is a different function for level doors.
void OnStart()
{
AddUseItemCallback("", "SecondLevel", "NextLevel", "UnlockNextLevel", true);
}
void UnlockNextLevel(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("NextLevel", false);
PlaySoundAtEntity("", "unlock_door", "NextLevel", 0, false);
RemoveItem("SecondLevel");
}
your script was also out of place for some reason. void OnStart() is always at the top.


(12-04-2011, 09:07 PM)JenniferOrange Wrote: [ -> ]your script was also out of place for some reason. void OnStart() is always at the top.

It doesn't have to be, since the compiler compiles the entire script to bytecode before making use of it.
Thank you it work Smile
But when the door is locked, I put a SetEntityInteractCallback, is that after using the key you can remove it?