Jump to content

Furniture script


Recommended Posts

I am trying to determine if it is possible to check if a player is entering (ie. about to sit, lie) OR exiting a piece of furniture. I know you can use OnActivate, but that is no good (at least in the ways I have tried), because I need to know (and keep track of) if the player is getting up from, is starting to use or is using the furniture. I want to avoid using OBSE. Each attempt I have made has ended up with the condition firing whether the player sits or gets up. My head hurts.

 

Imaginary scenario:

A player sits on a chair, at which point a sound plays.

While the player is *still* sitting on the chair a sound plays intermittently at random.

When the player gets up off the chair no more sounds, especially at the stage of exiting the chair (this is where I have stumbled using OnActivate).

 

Hope that makes sense.

Link to comment
Share on other sites

Thank you both, I will give GetSitting a try.

 

Update: Thanks guys, GetSitting was just the job. :thumbsup:

Link to comment
Share on other sites

Thank you both, I will give GetSitting a try.

 

Update: Thanks guys, GetSitting was just the job. :thumbsup:

 

 

Perfect then. What's your code if we can be curious?

Link to comment
Share on other sites

Thank you both, I will give GetSitting a try.

 

Update: Thanks guys, GetSitting was just the job. :thumbsup:

 

 

Perfect then. What's your code if we can be curious?

 

In essence:

   	; Make sure the player is not already sitting, or waiting to get up
   	If ( ( player.GetSitting != 3 ) && ( player.GetSitting != 4 ) )
		; Do some stuff
   	EndIf

Link to comment
Share on other sites

  • Recently Browsing   0 members

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