Jump to content
  • 0

Changing a player variable when item is worn and then changing it back when removed.


NetSkeleton

Question

Hello, I have a custom variable I would like to change when the player wears an item and then I would like to revert that change when they remove it.

 

Hat worn = 0

Player wears hat..

Hat worn = 1

Player removes hat..

Hat worn = 0

 

I am playing around with events and I figured out how to add to a variable when they wear it but I can't determine a good way to check if they removed it without that becoming to complex.

 

I am looking for what approach you would use mostly when using events for this issue.

 

At the moment I have an event that runs on the item when it is used which adds to the variable and then equips the hat from that event.

 

I was trying to make an event that checked when equipment changes but it is wonky as it will change the variable on any equipment change if it detects they wore something besides the hat.

 

Thank you for any guidance on this issue.

 

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 1

Create a single common event "Equipment Checker"
Have it trigger on "Equipment Changed"
Add a conditional branch
   - Item Equipped is: - Your Hat Item
      - Set Variable to True
   - Else
      - Set Variable to False

This event can be expanded to check ANY specific equipment for quests/etc.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...