Frictional Games Forum (read-only)

Full Version: Cannot use item on area
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I've placed a ScriptArea around a statue, and I want the player to use an item on the area to place it in the statue's hand. Here's the script:

PHP Code:
void OnStart()
{
    
AddUseItemCallback("""copper_tube_1""PlaceArea""PlaceCopper1"true);
}

void PlaceCopper1(string &in asItemstring &in asEntity)
{
    
RemoveItem("copper_tube_1");
    
SetEntityActive("copper_tube_4"true);
    
PlaySoundAtEntity("""pick_pipe""copper_tube_4"0false);


The ScriptArea's Item Interaction box is checked, I've double/triple/quadruple-checked. The item interaction works when I designate any other entity, but it won't work with the ScriptArea.
Since a factor of this issue is from the level editor, make sure you delete any map cache you may have.
No map caches here.
Put "PlaceCopper1" in the entry box in PlayerInteractCallback and remove the function in the OnStart()
That only works for the player interacting with it, not using an item on it.
Have you checked that PlayerLookAtAutoRemove is Unchecked? Because always when i make a new area it is checked and that is kinda annoying
Yeah, I unchecked that, but it's still not working.

I am very very desperate to get this working, so I added the map and script to my first post if anyone wants to download it and check it out. The copper tube is floating in the room near the clay tablet and has to be used on one of the statues.

If anyone can please please please help me out I will be eternally grateful. ;;
Have you tried to put the PlaceCopper1 function in "Player Interact Callback" ?
Like I said before, that only works when the player interacts with the area, not when an item is used on it.
Tested it, worked exactly as the script shows it should.
Pages: 1 2