Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ScriptName C4DetonatorScript extends ObjectReference Const
- Keyword Property RemoteExplosive Auto Const ; Add this Keyword to objects which you wish to be triggered by the detonator
- float Property WorkingRadius Auto Const ; the property on the detonator object for the working radius in which to find RemoteExplosives
- Function OnEquipped()
- RegisterForAnimationEvent(Game.GetPlayer(), "WeaponFire")
- EndFunction
- Function OnUnequipped()
- UnregisterForAnimationEvent(Game.GetPlayer(), "WeaponFire")
- EndFunction
- Event OnAnimationEvent(ObjectReference akSource, string asEventName)
- ObjectReference[] RemoteExplosiveList = akSource.FindAllReferencesWithKeyword(RemoteExplosive, WorkingRadius)
- int i = RemoteExplosiveList.length-1
- While (i <= 0)
- RemoteExplosiveList[i].DamageObject(100)
- { I think mines handle explosions themself if they're damage,
- or it needs to be replaced with another function }
- EndWhile
- EndEvent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement