Slikpik Posted March 3, 2013 Share Posted March 3, 2013 I've got a detonator. You aim at something that's locked with it and upon firing, it unlocks... The script compiles but it wont work in game. Here's the script scn SLIKUnlocker Short Item Begin OnFire if (GetCrosshairRef GetLockLevel > 1) Set Item to GetCrosshairRef Unlock Item endif end What needs changed? Link to comment Share on other sites More sharing options...
Xaranth Posted March 3, 2013 Share Posted March 3, 2013 (edited) Item needs to be a ref type, not a short type. Edit: Also, unlock is a reference function, not a global function, so the proper syntax is Item.unlock Edited March 3, 2013 by Xaranth Link to comment Share on other sites More sharing options...
Slikpik Posted March 3, 2013 Author Share Posted March 3, 2013 Ok so I've changed the script a bit but it still wont unlock the item. scn SLIKUnlocker ref Item Begin OnFire if (GetCrosshairRef GetLockLevel > 1) Set Item to GetCrosshairRef Item.Unlock endif end Link to comment Share on other sites More sharing options...
Xaranth Posted March 3, 2013 Share Posted March 3, 2013 GetLockLevel is also a reference function. Try it this way:set Item to GetCrosshairRef if (Item.GetLockLevel > 0) if (Item.GetLockLevel <= 100) ;Prevents it from unlocking 'requires key' locks. Item.Unlock endIf endIf Link to comment Share on other sites More sharing options...
Slikpik Posted March 3, 2013 Author Share Posted March 3, 2013 Thanks man. You are the best! Kudos to you Link to comment Share on other sites More sharing options...
Recommended Posts