Jump to content

Leveled opening at locks


Recommended Posts

I'm having trouble making a script where once the player reaches at least the target level, an object unlocks and then the player can access what's inside.

 

Probably would run on GameMode, and be a conditional where if the player is, say, level 5, then unlock it. Else, it stays locked until then. Problem is, I don't know how to set up the script. I have the basic idea down, but I'm not really sure how to have it check the player's level. Can someone write it up quick so I can see how it should look?

Link to comment
Share on other sites

Make a copy of a container that you want to use. After placing the container in the editor, set the lock level on the container to 'requires key'. Then place a script on the box.

 

scn MyContainerScript

short iDoOnce

BEGIN GAMEMode

if iDoOnce
else
if Player.GetLevel >= 5
  	Unlock
  	set iDoOnce to 1
  endif
endif

END

Link to comment
Share on other sites

  • Recently Browsing   0 members

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