Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ScriptName RDE_DetonationScript extends ObjectReference Const
- Keyword Property pRemoteExplosive Auto Const ; Add this Keyword to objects which you wish to be triggered by the detonator
- float Property WorkingRadius Auto Const ; Set the unit radius within which to find explosived to detonate
- Function OnEquipped(Actor akActor)
- If (akActor == Game.GetPlayer())
- RegisterForAnimationEvent(akActor, "WeaponFire")
- EndIf
- EndFunction
- Function OnUnequipped(Actor akActor)
- If (akActor == Game.GetPlayer())
- UnregisterForAnimationEvent(akActor, "WeaponFire")
- EndIf
- EndFunction
- Event OnAnimationEvent(ObjectReference akSource, string asEventName)
- ObjectReference[] RemoteExplosiveList = akSource.FindAllReferencesWithKeyword(pRemoteExplosive, WorkingRadius)
- int i = RemoteExplosiveList.length-1
- While (i <= 0)
- RemoteExplosiveList[i].DamageObject(100)
- EndWhile
- EndEvent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement