Advertisement
Guest User

Untitled

a guest
May 28th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. ScriptName C4DetonatorScript extends ObjectReference Const
  2.  
  3. Keyword Property RemoteExplosive Auto Const ; Add this Keyword to objects which you wish to be triggered by the detonator
  4. float Property WorkingRadius Auto Const ; the property on the detonator object for the working radius in which to find RemoteExplosives
  5.  
  6. Function OnEquipped()
  7. RegisterForAnimationEvent(Game.GetPlayer(), "WeaponFire")
  8. EndFunction
  9.  
  10. Function OnUnequipped()
  11. UnregisterForAnimationEvent(Game.GetPlayer(), "WeaponFire")
  12. EndFunction
  13.  
  14. Event OnAnimationEvent(ObjectReference akSource, string asEventName)
  15. ObjectReference[] RemoteExplosiveList = akSource.FindAllReferencesWithKeyword(RemoteExplosive, WorkingRadius)
  16. int i = RemoteExplosiveList.length-1
  17. While (i <= 0)
  18. RemoteExplosiveList[i].DamageObject(100)
  19. { I think mines handle explosions themself if they're damage,
  20. or it needs to be replaced with another function }
  21. EndWhile
  22. EndEvent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement