Jump to content

Recommended Posts

Posted

Hello everyone,

 

I need help figuring out how to get my activator to disable upon being activated. Below is a script connected to the activator:

Scriptname PS_AmmoPouchScript extends ObjectReference

Ammo Property Ammo308Caliber Auto
ObjectReference Property PL_AmmoPouchActivator Auto


Event OnActivate(ObjectReference akActionRef)
   if akActionRef == Game.GetPlayer()
      Game.GetPlayer().AddItem(Ammo308Caliber, 20, true)
   endif
EndEvent

What I need help with is finding a way to disable the activator once it gives the player the ammo & display a message saying "20 .308 Rounds added" like when you pick up a chem or another item. If you could lend a hand, it would be greatly appreciated!

Posted (edited)

if akActionRef == Game.GetPlayer()
Game.GetPlayer().AddItem(Ammo308Caliber, 20, true)
utility.wait(0.1)
Disable()
endif
Edited by Rasikko
Posted

plus if your never going to use that activator again, to help keep the system clean ("Self." is inferred, so optional):

Self.Disable()
Self.Delete()
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...