Frictional Games Forum (read-only)

Full Version: Function doesn't get called after interaction
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want my player to get teleported when he uses an altar knife on the floor. But when i interact with it, nothing happens. I leave you my .hps file so you can find the error:

Quote:////////////////////////////
// Run when the map starts
void OnStart()
{
void sleep(string& dreams, string& PlayerStartArea_1, string& asStartSound, string& asEndSound;
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}
Thanks in advance
Your script is basically empty.
Have a look at the Frictional Games Wiki to get help about scripting.
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "knife", "floor", "sleep", true);
}

void sleep(string &in asItem, string &in asEntity)
{
(write the scripts that you want to call here)
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}