Jump to content

Open Container with a Message Box


alex5776

Recommended Posts

Hey,

 

I wanted to make a player home with an first aid box, that acts

as the "my first infirmary" and a container for medical stuff. The

question is, how is the script for opening a container that is out

of the room?

Link to comment
Share on other sites

In the container's Reference window, make sure the Persistent Reference box is ticked, and give it a unique Reference ID (unless it already has one).

You can then open the container from any script by using the container's Ref ID and calling:

ContainerRef.Activate player
Link to comment
Share on other sites

 

In the container's Reference window, make sure the Persistent Reference box is ticked, and give it a unique Reference ID (unless it already has one).

You can then open the container from any script by using the container's Ref ID and calling:

ContainerRef.Activate player

 

So I just have to do an elseif Choice in the script and name it for example:

 

FirstAidBox.Activate player

 

And by the reference id is meant the id when its in the interior already right?

Link to comment
Share on other sites

And by the reference id is meant the id when its in the interior already right?

Yes. When you place an object in the Render Window, double-clicking it will open the Reference window I was referring to in my reply. Type a unique ID in the Reference Editor ID field, then use it in the script line (in place of ContainerRef).

Link to comment
Share on other sites

  • Recently Browsing   0 members

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