In this tutorial, we use hiding and showing props and shield granters to imitate the equipping of armor.
What you will need:
- 2x Triggers
- 1x Health Granter
- 1x Property (isArmored?)
- 1x Lifecycle Detector
- 1x Empty Spacesuit Closet
- 1x Full Spacesuit Closet
Make sure to set the starting shield to 0%, or this will not work! You can change that in Options > Map Options > Health & Shield.
Part 1 - Adding Health
Place down a Boolean (true/false) Property called isArmored and a Health Granter. Go into the health granter. The health granter should be granting shield, not health, and should add anywhere between +25 to +50, depending on the strength of your armor.
For the property, make sure it is true/false, only updated by a player, and starts off as false, not true. Place down 2 triggers. The first trigger should set isArmored to true, while the second one should set it to false.
Also, go into the first trigger, and put the script into an if-do block. Make it check if isArmored is false. This way it doesn’t update your health multiple times. Also, make it broadcast a new channel called increaseHealth.
Part 2 - Wires & Channels
Go into the health granter and make it activate when increaseHealth is called. Place down a lifecycle detector. Make it activate when a player dies. Have the lifecycle detector run into the second trigger, making it activate when the player dies.
Next, place down a zone. Make it so that when you enter the zone, it triggers the first trigger.
Part 3 - Showing/Hiding the Cabinets
Place down an empty and a full Spacesuit Cabinet. Make sure they aren’t overlayed, or you won’t be able to run wires between them. This is what we will use for our armor stand equipping station. Run a wire from the first trigger into the cabinets. The first trigger should show the empty cabinet and hide the full one. The second trigger should do the opposite; hide the empty cabinet and show the full one.
Also, make sure the full cabinet starts off visible and the empty one starts off invisible. (Change that in the availability tab).
All of the technical stuff is done! Layer the two cabinets over eachother and your armor stand is complete! I hope this works for your game, and most of all, thanks for reading!