Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Item Interaction
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#4
RE: Item Interaction

(08-13-2013, 06:48 AM)JustAnotherPlayer Wrote:
void OnStart()
{
AddUseItemCallback("", "Bone_Saw", "Wooden_Board", "BreakBoard", true);
}

void BreakBoard(string &in asItem, string &in asEntity)
{
SetEntityActive("Wooden_Board", false);
SetEntityActive("Broken_Board", true);
}

That's the code.
Bone_Saw is the Item you use the Entity on.
Wooden_Board is the board that gets replaced by the broken one and the Entity the Item is used on.
Broken_Board is the broken board.

Please note that the bone saw has to be an item in your inventory.

Instead of having 2 entities, using SetPropHealth("Wooden_Board", 0); would do the same thing.

Trying is the first step to success.
08-13-2013, 09:36 PM
Find


Messages In This Thread
Item Interaction - by Scorch 169 - 08-13-2013, 03:49 AM
RE: Item Interaction - by PutraenusAlivius - 08-13-2013, 06:48 AM
RE: Item Interaction - by FlawlessHappiness - 08-13-2013, 09:36 PM
RE: Item Interaction - by Slanderous - 08-13-2013, 03:32 PM



Users browsing this thread: 2 Guest(s)