kibblesticks Posted June 10, 2011 Share Posted June 10, 2011 Hey guys, I really need some help I need a script for a weapon that causes containers, doors and terminals to unlock when shot at. I honestly can't work out where to start, so if any kind soul feels like putting me out of my misery I'll be most appreciative! :thumbsup: Link to comment Share on other sites More sharing options...
rickerhk Posted June 11, 2011 Share Posted June 11, 2011 I haven't done this before, but I have used GetAnimAction to detect if the player has fired a shot, and it works every time.I would start with this (requires FOSE): scn MyWeaponUnlockScript short iAmEquipped short iWeaponAnim short iObjectType ref rBaseObjectREF ref rTargetREF BEGIN ONEquip Player set iAmEquipped to 1 END BEGIN ONUnequip set iAmEquipped to 0 END BEGIN ONDrop set iAmEquipped to 0 END BEGIN GameMode if (iAmEquipped == 0) return endif set iWeaponAnim to Player.GetAnimAction if ((iWeaponAnim > 1) && (iWeaponAnim < 7)) ; weapon animation captures that a shot was fired set rTargetREF to GetCrosshairREF ;Must be within activation distance of locked object if (rTargetREF) set rBaseObjectREF to rTargetREF.GetBaseObject set iObjectType to GetObjectType rBaseObjectREF if ((iObjectType == 23) || (iObjectType == 27) || (iObjectType == 28)) ;Terminal, Container, Door If (rTargetREF.GetLocked) rTargetREF.Unlock rTargetREF.PlaySound UILockpickingUnlock else return endif endif endif endif END Link to comment Share on other sites More sharing options...
kibblesticks Posted June 11, 2011 Author Share Posted June 11, 2011 Thanks rickerhk! I'll try it out =] Link to comment Share on other sites More sharing options...
lostone1993 Posted June 11, 2011 Share Posted June 11, 2011 If i remember right there is a way to do it without fose, ive done it before, il try to find the mod Link to comment Share on other sites More sharing options...
Recommended Posts