Jump to content

Tiny help with tiny script...


Jokerine

Recommended Posts

Hello everybody! There's a little question I have here for the scripting pros. :)

 

I know it must be possible and I must be missing something really simple, but I'm hoping to make a script for a harvestable item where the activator itself will get disabled after giving the player an item.

 

I know I could just give the activator a ref and then simply call the script to disable that specific ref after giving the player an item, but I'm gonna have several copies of the activator in question so I was hoping to have a script I can reuse.

 

Any help will be appreciated! :)

Link to comment
Share on other sites

Attach this to the harvestable activator form:

Begin OnActivate
    If IsActionRef Player
        Player.AddItem {parameters here}
        Disable
        MarkForDelete
    EndIf
End

Disable and MarkForDelete will be run implicitly on the activated reference, so there's no need to give them editor IDs or make them persistent.

 

Disabled references stay in the game world, MarkForDelete will make sure they despawn completely.

Edited by Ladez
Link to comment
Share on other sites

  • Recently Browsing   0 members

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