Frictional Games Forum (read-only)

Full Version: removeitem not working for lantern.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I just want the lantern to be removed from the inventory after changing the map.Tried having just removeitem under void OnStart as well. Thought useing a timer might work , but it doesn't do anything. The only thing that happens is it puts the lantern away, but if i use the debug menu to reload the map it works.

////////////////////////////
// Run when the map starts


void OnStart()
{
SetLanternActive(false,true);
AddTimer("",1,"RemoveLantern");
AutoSave();
}

void RemoveLantern(string &in asTimer)
{
RemoveItem("lantern");
}
Use the level editor name of the lantern, so unless you changed it, it should be "RemoveItem("lantern_1");
I would change the name of the item to something else though to prevent bugs later on if you will allow for a second lantern to be picked up. So rename the first one to something like: "Lantern01" then use RemoveItem("Lantern01");

If you continue to have issues please contact me so I can help!
thanks worked perfectly!