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 How to make item unlootable?
TheGreatCthulhu Offline
Member

Posts: 213
Threads: 10
Joined: Oct 2010
Reputation: 32
#4
RE: How to make item unlootable?

If the item doesn't have to move around (like, bounce back when the player runs into it), you can just open the Level Editor, select the item, go to the Entity tab, and check, "StaticPhysics"; when done, just place a script area around it, and do something like this in the script file (inside OnEnter() function):
PHP Code: (Select All)
SetEntityInteractionDisabled("itemname"true);

// and then (for player "hand-based" interactions):
SetEntityPlayerInteractCallback("ScriptArea_1""MyFunc"false);

// or rather (to use an item on it):
AddUseItemCallback("internalCallbackID""itemToUseID""ScriptArea_1""MyFunc"true); 

Of course, replace "itemname", "itemToUseID", "ScriptArea_1" and "MyFunc" with the names you're using, and "internalCallbackID" with whatever you want.
(This post was last modified: 01-18-2013, 05:03 AM by TheGreatCthulhu.)
01-18-2013, 01:20 AM
Find


Messages In This Thread
How to make item unlootable? - by IWT - 01-18-2013, 12:38 AM
RE: How to make item unlootable? - by Daemian - 01-18-2013, 12:47 AM
RE: How to make item unlootable? - by IWT - 01-18-2013, 01:06 AM
RE: How to make item unlootable? - by TheGreatCthulhu - 01-18-2013, 01:20 AM
RE: How to make item unlootable? - by IWT - 01-18-2013, 01:06 PM



Users browsing this thread: 1 Guest(s)