Create
elo-hell-archive

In-world Togglable Button by purplg#1141

This code is over 6 months old. The code may have expired and might no longer function.

Description

This is a button you can place in the world and each player can toggle independently, meaning each player gets their own settings on whether they have toggled the button on or off.

Video

Explanation

Global Variable A contains settings for the button in the form of an array with the following values:

  1. Position of button (Must change!)
  2. Radius of button
  3. Focus distance for button

Player Variable A contains an array with the state of the button for the player

  1. Whether button is focused or not
  2. Whether button has been pressed into active state

If you want to change the effects of the button, go to the rule BUTTON: EFFECTS.
This rule has 6 actions. The first 3 are the effects for the Inactive state of the button and the last 3 are the effects for the Active (pressed) state.

  1. In-world text that says on/off
  2. Effect of the actual button
  3. Effect while hovering

Implementation

Copy all the rules except DEBUG: TELEPORT into your gamemode. You are going to have to change every reference of either Global Variable A or Player Variable A to your own respective variables. There is only 1 Global and 1 Player variable used. Make sure not to change the indices!

BUTTON: GLOBAL: INIT

Actions
4 Global

BUTTON: PLAYER: INIT

Actions
5 Player

BUTTON: EFFECTS

Actions
10 Global
8 Player

BUTTON: FOCUS

Conditions
6 Global
1 Player

Actions
1 Player

BUTTON: UNFOCUS

Conditions
6 Global
1 Player

Actions
1 Player

BUTTON: INTERACT

Conditions
1 Player

Actions
1 Global
4 Player


Archival Notice

This post was originally hosted on workshop.elohell.gg, a site which is no longer online. If this was originally your post, you may click the button below to transfer this post to your Workshop.codes account or delete this post entirely.

Archive Actions
Players | 1 - 12
Categories: Tools
Heroes: D.va, Junker Queen, Orisa, Reinhardt, Roadhog, and 29 more...
Created at:
Last updated:
Current version: 1.0.0

Similar Codes

Join the Workshop.codes Discord