Jump to content

Script to unlock safe with specific item.


JustAnotherModder93

Recommended Posts

Hi all, I'm very new to scripting and modding in general, but was wondering if anyone could help me with a script.

I'm trying to make those damn lottery tickets actually useful in the game, by putting in a safe that can only be unlocked by having one of these lottery tickets.
Or perhaps having a character in the game who will give you items in exchange for one of the lottery tickets.

Any help would be greatly appreciated.

 

EDIT
Going to retry
If Player.HasItem ObjectID 1
Unlock
EndIf

 

I think I tried it previously and it didn't work, but I'll put it in again.

 

EDIT 2
I have tried every variation of the above "script" I can think of, and it just won't save.

Begin GameMode

If Player.GetItemCount NiptonLotteryTicket ==1
Unlock
EndIf

 

End

 

^ Just one of the many variations.

Edited by JustAnotherModder93
Link to comment
Share on other sites

Been a while since I've done any scripting but try adding this script to the safe you want it to affect.

 

SCN ScriptName

 

Begin OnActivate

If Player.GetItemCount NiptonLotteryTicket >= 1
Unlock
Player.RemoveItem NiptonLotteryTicket 1
Else
Return
Endif

End

Link to comment
Share on other sites

  • Recently Browsing   0 members

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