#MC Dungeons lost health effect

1 messages · Page 1 of 1 (latest)

frosty roverBOT
#

Your script never runs again after the first trigger, so the timer/alpha never update. Hook it up to a Ticker element instead of just running it once—tickers continuously execute their action scripts (see the “Ticker” entry in the Elements doc). Set it to tick every few milliseconds and let it:

  1. Compare current_player_health_percent vs your prev_health_percent; if it dropped, set health_flash_timer = 10 and health_flash_alpha = 1.
  2. When health_flash_timer hits 0, update prev_health_percent to the current value.
  3. Always run your maxnum/calc actions so the timer subtracts 1 each tick and the alpha fades.

That way the timer decrements and the previous-health value refreshes automatically. You can find the ticker description here: Ticker Element.

atomic kernel
#

This code is within a ticker action script but it still doesent count the prev health and flash timer down

frosty roverBOT
# atomic kernel This code is within a ticker action script but it still doesent count the prev h...

Looks like the ticker action fails because your nested placeholders are turned into literal strings—FancyMenu expects proper JSON objects, not "{"placeholder":…}".

Fix it by removing the extra quotes around the nested placeholders. For example, the timer decrement should be:

{"placeholder":"maxnum","values":{
  "first":"0",
  "second":{
    "placeholder":"calc",
    "values":{
      "decimal":"true",
      "expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} - 1"
    }
  }
}}

And the alpha expression:

{"placeholder":"calc","values":{
  "decimal":"true",
  "expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} / 10"
}}

Make sure both placeholders are real objects (no extra quotes). Once the JSON is valid, the ticker will be able to decrement the timer and fade the alpha every tick.

atomic kernel
#

show me the extra quotes you removed

frosty roverBOT
# atomic kernel show me the extra quotes you removed

Here’s what needed fixing: every nested placeholder was wrapped in a string ("{"placeholder":…}"), so FancyMenu treated it as literal text instead of evaluating the placeholder. You must drop those extra quotes and let the placeholder stay as a proper JSON object.

Example you had

{"placeholder":"maxnum","values":{"first":"0","second":"{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} - 1"}}"}}

Fixed version (no extra quotes around the nested placeholders)

{"placeholder":"maxnum","values":{"first":"0","second":{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} - 1"}}}}

Same for the alpha calculation: remove the quotes around the calc placeholder so it becomes a JSON object instead of a string.

Once those placeholders are proper objects, the ticker can actually evaluate them every tick and your timer/alpha will count down correctly. For reference on how placeholders nest, check the Placeholders guide.

atomic kernel
#

the timer and previous health still dont count down

frosty roverBOT
# atomic kernel the timer and previous health still dont count down

Since the script still doesn’t step down, I need a bit more context to help diagnose it:

  1. Ticker setup – Is the ticker’s mode set to “Normal” or “Every Tick”? If it’s only ticking once (e.g., “On Screen Load”), the script won’t run again. The Ticker element doc explains the tick modes.

  2. Action script execution – Are there any loading requirements on the ticker or its actions that might stop the script from running after the first tick? If a requirement fails, the Set Variable Value actions won’t fire.

  3. Variable values – After you take damage, does the health_flash_timer variable show 10 (you can check via a text element or /fmvariable)? Are you seeing the calc placeholder return a number (no quotes around placeholders)?

If you can share the ticker settings, any loading requirements applied, and whether the variables are actually updating, I can give you concrete adjustments.

atomic kernel
#

Ticker is at 50 ms, normal mode. there are no loading requirements and the health_flash_timer shows 10 after taking damage but wont count down

frosty roverBOT
# atomic kernel Ticker is at 50 ms, normal mode. there are no loading requirements and the healt...

Two things to double-check:

  1. The nested placeholders must stay as JSON objects.
    Your maxnum/calc lines still look like they might include extra quotes, which makes the expressions never evaluate (they just stay at 10). Make sure they look exactly like this (no "..." wrapping the inner placeholders):

    {"placeholder":"calc","values":{
      "decimal":"true",
      "expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} - 1"
    }}
    

    and

    {"placeholder":"maxnum","values":{
      "first":"0",
      "second":{
        "placeholder":"calc",
        "values":{}
      }
    }}
    

    If they’re still serialized as strings, the ticker can’t do math. The placeholder guide shows how to nest them correctly.

  2. Don’t reset the timer before the countdown runs.
    Right now you always subtract 1 every tick, even immediately after a damage event resets it to 10, so the countdown never takes effect. Split the logic so the countdown only runs when the timer is already above 0:

    ▶ IF (Is Number getvariable:health_flash_timer > 0)
      └─ Set Variable Value health_flash_timer:{...calc...}
      └─ Set Variable Value health_flash_alpha:{...calc...}
    ▶ IF (current_player_health_percent < prev_health_percent)
      └─ Set Variable Value health_flash_timer:10
      └─ Set Variable Value health_flash_alpha:1
    ▶ IF (Is Number getvariable:health_flash_timer = 0)
      └─ Set Variable Value prev_health_percent:{"placeholder":"current_player_health_percent"}
    

    This keeps the timer counting down during the flash instead of being immediately clamped back by the damage branch.

Try those two adjustments and the ticker should start decreasing health_flash_timer and updating prev_health_percent as intended.

atomic kernel
#

I dont understand what you mean by remove the "..." wrapping the placeholders. there is no change between my code and the code you give me

frosty roverBOT
# atomic kernel I dont understand what you mean by remove the "..." wrapping the placeholders. t...

Ahhh I see the confusion—your current code still wraps the nested placeholders in quotes, so FancyMenu never actually evaluates them. The difference is subtle but crucial: the placeholder must stay as a JSON object, not a string.

❌ What your ticker currently sends (broken):

"second":"{"placeholder":"calc",...}"

Here the whole calc placeholder is treated as a plain string because of the surrounding quotes.

✅ What it must look like (working):

"second":{
  "placeholder":"calc",
  ...
}

Now FancyMenu correctly sees the nested placeholder and runs the math every tick. The same applies to the calc that updates health_flash_alpha—remove the quotes so the object stays intact.

So go through both lines, delete the wrapping " around the {/} of each nested placeholder, and make sure the structure matches the "working" example above. Once that’s done, the ticker will actually decrement health_flash_timer. Let me know if you want me to rewrite the full action script with the corrected JSON!

atomic kernel
#

give me a new version of this code with proper formatting:

health_flash_timer:{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} / 10"}}

health_flash_alpha:{"placeholder":"maxnum","values":{"first":"0","second":{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} - 1"}}}}

frosty roverBOT
# atomic kernel give me a new version of this code with proper formatting: health_flash_timer:{...

Here’s the correctly formatted version—note that the inner placeholders are JSON objects (no string quotes around them), so FancyMenu actually evaluates them:

health_flash_timer:{
  "placeholder":"calc",
  "values":{
    "decimal":"true",
    "expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} / 10"
  }
}

health_flash_alpha:{
  "placeholder":"maxnum",
  "values":{
    "first":"0",
    "second":{
      "placeholder":"calc",
      "values":{
        "decimal":"true",
        "expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} - 1"
      }
    }
  }
}

If you want to nest even more placeholders later, the Placeholders guide shows how JSON nesting works.

atomic kernel
#

now its setting my health flash timer to 1.0 and keeping it there

frosty roverBOT
# atomic kernel now its setting my health flash timer to 1.0 and keeping it there

Right now you’re overwriting the timer with calc(... / 10), so it immediately becomes 1 and never drops below that. What you want is:

  • health_flash_timer decrements by 1 (clamped at 0) every tick, so use the maxnum + calc combo.
  • health_flash_alpha is the only one that should divide by 10.

Also gate both actions behind health_flash_timer > 0 so they only run while the flash is active, otherwise the timer keeps being reset to 1 every tick.

Here’s the correct structure:

▶ IF (Is Number: {"placeholder":"getvariable","values":{"name":"health_flash_timer"}} > 0)
  └─ Set Variable Value: health_flash_timer:{
      "placeholder":"maxnum",
      "values":{
        "first":"0",
        "second":{
          "placeholder":"calc",
          "values":{
            "decimal":"true",
            "expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} - 1"
          }
        }
      }
    }
  └─ Set Variable Value: health_flash_alpha:{
      "placeholder":"calc",
      "values":{
        "decimal":"true",
        "expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} / 10"
      }
    }

Then elsewhere (still in your ticker) keep the damage detection and prev_health_percent update as you had before. That way the timer only runs when it should, and alpha follows the timer’s value.

If you’d like to see how nested placeholders should look in general, the Placeholders doc shows the proper JSON structure.

atomic kernel
#

please write the code into a single line

frosty roverBOT
# atomic kernel please write the code into a single line

Sure! Here are the two updated actions on a single line each—make sure they’re inside the IF (health_flash_timer > 0) block so the countdown actually runs:

Set Variable Value: health_flash_timer:{"placeholder":"maxnum","values":{"first":"0","second":{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} - 1"}}}}
Set Variable Value: health_flash_alpha:{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} / 10"}}

That keeps the timer from dropping below 0 while the alpha simply mirrors the timer value divided by 10.

atomic kernel
#

now the timer shows as {"placeholder":"maxnum","values":{"first":"0","second":{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} - 1"}}}}

frosty roverBOT
# atomic kernel now the timer shows as {"placeholder":"maxnum","values":{"first":"0","second":{"...

If the action output still shows the whole JSON text (e.g. {"placeholder":"maxnum"...}) instead of a number, it means FancyMenu is seeing your placeholder as a literal string. In action scripts you must insert the placeholder as a JSON object, not as text, so it can be evaluated.

To fix it:

  1. Open the action script and edit the value.
  2. Use the “Insert Placeholder” button in the editor and pick the calculator/maxnum placeholder you need. That ensures FancyMenu inserts the JSON object directly instead of you typing it manually.
  3. Remove any extra quotation marks around the placeholder so it looks like:
    {"placeholder":"maxnum","values":{"first":"0","second":{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} - 1"}}}}
    
    (and analogously for the alpha line).

Once the placeholders are stored as objects, the ticker will evaluate them and the timer/alpha will actually change instead of showing the JSON text. For reference on nesting placeholders correctly, check the Placeholders guide.

#

Ahh, I think the issue is that FancyMenu still sees the placeholder as a string instead of evaluating it. To fix that, you have to paste the placeholder JSON directly as the action value (no surrounding quotes) so FancyMenu can run it.

Here’s how the values must look as JSON objects (single line each):

Set Variable Value: health_flash_timer:{"placeholder":"maxnum","values":{"first":"0","second":{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} - 1"}}}}
Set Variable Value: health_flash_alpha:{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} / 10"}}

If you typed or pasted those into the script but the editor still shows it as a string (with quotes around the {), delete the value and insert it again via the “Insert Placeholder” button so FancyMenu stores it as proper JSON. Once that’s done, the ticker will evaluate the placeholder instead of just showing the literal text.

atomic kernel
#

the string shows as:

health_flash_timer:{"placeholder":"maxnum","values":{"first":"0","second":"{"placeholder":"calc","values":{"expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer - 1"}}","decimal":"true"}}"}}

frosty roverBOT
# atomic kernel the string shows as: health_flash_timer:{"placeholder":"maxnum","values":{"firs...

Your placeholder is still being treated as text because the nested {…} blocks are wrapped in quotes. FancyMenu expects them as JSON objects, so remove the quotes around the inner placeholders and keep the expression outside them.

Use these exact single-line values:

Set Variable Value: health_flash_timer:{"placeholder":"maxnum","values":{"first":"0","second":{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} - 1"}}}}
Set Variable Value: health_flash_alpha:{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} / 10"}}

That means the calc placeholder is a real object (no "{"/"}" wrapping it). If you still see the JSON text after pasting, delete the value and use the “Insert Placeholder” button so FancyMenu stores it properly. Once they’re stored as objects, the ticker will actually evaluate them each tick instead of printing the literal string. You can check the approach in the Placeholders guide.

atomic kernel
#

your code isnt working. guide me through creating it myself with exact steps

frosty roverBOT
# atomic kernel your code isnt working. guide me through creating it myself with exact steps

Let’s rebuild those actions the way FancyMenu expects them, step by step. The goal is to make the ticker run this every tick:

  • If health_flash_timer > 0, subtract 1 (clamped at 0) and update alpha.
  • Make sure both placeholders are inserted as real JSON objects so FancyMenu evaluates them instead of showing literal text.

1. Open the ticker’s action script

  1. Select your Ticker element.
  2. Right-click → Manage Action Script.
  3. Make sure there’s an IF statement checking if health_flash_timer > 0. If not, add one:
    • Add Requirement → Is Number.
    • Click “Edit Requirement Value”.
    • For target value use the “Get Variable” placeholder (insert it via the placeholder list) with name = health_flash_timer.
    • Set comparison to greater-than and compare with 0.

2. Inside that IF block, add the timer decrement

  1. Click “Add Action” inside the IF.
  2. Choose Set Variable Value [FM Variable].
  3. Set Variable Name to health_flash_timer.
  4. For the action value:
    • Click the Insert Placeholder button in the editor.
    • Select the maxnum placeholder.
    • In the first field type 0.
    • In the second field click “Insert Placeholder” again, choose calc.
      • Set decimal = true.
      • For expression, again use Insert Placeholder → getvariable (name = health_flash_timer), then type - 1 after it. The expression should look exactly like:
        {"placeholder":"getvariable","values":{"name":"health_flash_timer"}} - 1
        
    • Don’t add quotes around any of these placeholders—they must stay as JSON objects. If you typed them manually, delete and re-insert via the button so FancyMenu stores them properly.
#

3. Add the alpha update

  1. Still inside the IF, add another Set Variable Value action.
  2. Name = health_flash_alpha.
  3. For the value, insert the calc placeholder:
    • decimal = true.
    • expression = <getvariable health_flash_timer placeholder> / 10.
    • Again use the placeholder picker so the inner placeholder stays a JSON object.

4. Outside the IF, keep your damage detection logic

  • Your existing logic that compares current_player_health_percent to prev_health_percent and resets health_flash_timer = 10 / health_flash_alpha = 1 stays unchanged.
  • Make sure the “set prev_health_percent” action only runs when health_flash_timer = 0, so it updates after the flash completes.

Why this works

  • Using Insert Placeholder prevents FancyMenu from saving the placeholder as a string ("{"placeholder":…}")—that’s what was keeping the timer stuck at literal JSON.
  • The timer only decrements when it’s already positive, so it won’t immediately drop back to 1 from the damage branch.

If you need visuals on how to insert placeholders, the Placeholders page shows the exact JSON structure FancyMenu expects. Let me know if you’d like me to walk you through inserting one of those placeholders with screenshots.

atomic kernel
#

now the timer ticks to 9.0 but stays there until health reaches 100%

frosty roverBOT
# atomic kernel now the timer ticks to 9.0 but stays there until health reaches 100%

Ahh, that’s the real root cause: your detection branch keeps firing every tick because prev_health_percent stays at the old value until the timer finally reaches 0. So each tick it sees current < prev, sets the timer back to 10, then your countdown subtracts it to 9—all while prev never updates—so it looks frozen at 9 until your health returns to 100% and the condition finally breaks.

Fix: Update prev_health_percent immediately after you detect the drop, so the condition stops true on the next tick.

Example order inside your ticker:

▶ IF (Is Number current_player_health_percent < getvariable prev_health_percent)
  └─ Set Variable Value health_flash_timer:10
  └─ Set Variable Value health_flash_alpha:1
  └─ Set Variable Value prev_health_percent:{"placeholder":"current_player_health_percent"}
▶ IF (Is Number getvariable health_flash_timer > 0)
  └─ Set Variable Value health_flash_timer:{maxnum calc...}
  └─ Set Variable Value health_flash_alpha:{calc ...}

Now the first branch only runs once per damage event (because prev_health_percent immediately matches current), so the timer can actually count down every tick without being reset to 10 again.

atomic kernel
#

it just makes prev_health match current_health on damage

frosty roverBOT
# atomic kernel it just makes prev_health match current_health on damage

Right, because you update prev_health_percent immediately when damage is detected, the “damage” condition is only true for one tick—and that’s fine. The timer now triggers, counts down, and the flash works.

If you instead want the flash to keep showing even while health is still below the old value (i.e., the timer keeps running until it naturally reaches 0), keep prev_health_percent from changing until after the flash timer hits 0. So:

  1. Damage detection (only when health drops):

    • Set health_flash_timer = 10
    • Set health_flash_alpha = 1
    • Do not touch prev_health_percent here.
  2. Timer countdown (only while timer > 0):

    • Decrement the timer (maxnum/calc) and update alpha.
  3. Once timer reaches 0:

    • Update prev_health_percent to current_player_health_percent.

That way the condition current < prev stays true while the flash runs, letting the timer tick down from 10 to 0. Only when the timer hits 0 do you refresh prev_health_percent, preventing the branch from re-triggering until the next damage event.

atomic kernel
#

show me these changes within the action script

frosty roverBOT
# atomic kernel show me these changes within the action script

Here’s how your ticker action script should be structured so the flash timer actually counts down and only resets prev_health_percent after the timer hits 0:

▶ IF (Is Number current_player_health_percent < prev_health_percent)
  └─ Set Variable Value health_flash_timer:10
  └─ Set Variable Value health_flash_alpha:1

▶ IF (Is Number getvariable:health_flash_timer > 0)
  └─ Set Variable Value health_flash_timer:{"placeholder":"maxnum","values":{"first":"0","second":{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} - 1"}}}}
  └─ Set Variable Value health_flash_alpha:{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} / 10"}}

▶ IF (Is Number getvariable:health_flash_timer = 0)
  └─ Set Variable Value prev_health_percent:{"placeholder":"current_player_health_percent"}
  • Make sure every placeholder is inserted via the placeholder picker so FancyMenu stores it as JSON (no extra quotes).
  • Keep the decrement/alpha update inside the health_flash_timer > 0 block so it only runs while the flash is active.
  • Only update prev_health_percent once the timer hits 0, so the “damage” branch doesn’t re-trigger until the next drop.

That setup gives you a one-time damage trigger, a clean countdown, and a delayed prev_health_percent update. If you need the exact menu clicks for adding these actions, let me know and I can spell out the UI steps too.

atomic kernel
#

this code doesent work. the timer still wont tick down until 100% health is reached

frosty roverBOT
# atomic kernel this code doesent work. the timer still wont tick down until 100% health is reac...

You’re right—the timer never counts down because your “damage detected” block keeps firing every tick as long as prev_health_percent is higher than current, so it instantly resets the timer back to 10 before the countdown can subtract anything.

Fix it by only running the damage block when the flash is currently inactive (i.e., health_flash_timer = 0). The ticker should look like this:

▶ IF (Is Number getvariable:health_flash_timer = 0)
  └─ IF (Is Number current_player_health_percent < getvariable:prev_health_percent)
      └─ Set Variable Value health_flash_timer:10
      └─ Set Variable Value health_flash_alpha:1

Then keep the countdown block as before:

▶ IF (Is Number getvariable:health_flash_timer > 0)
  └─ Set Variable Value health_flash_timer:{"placeholder":"maxnum","values":{"first":"0","second":{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} - 1"}}}}
  └─ Set Variable Value health_flash_alpha:{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} / 10"}}

...and finally, after that countdown finishes:

▶ IF (Is Number getvariable:health_flash_timer = 0)
  └─ Set Variable Value prev_health_percent:{"placeholder":"current_player_health_percent"}

This way the damage branch can only trigger when the flash isn’t already running, letting the timer tick from 10 down to 0. Make sure all nested placeholders are inserted as JSON objects (no extra quotes) so they can evaluate each tick.

atomic kernel
#

now the prev health and current health matches every time damage is taken

frosty roverBOT
# atomic kernel now the prev health and current health matches every time damage is taken

Let’s fix it so the timer can actually count down instead of immediately resetting:

Action script structure inside your ticker:

▶ IF (Is Number getvariable:health_flash_timer = 0)
  └─ IF (Is Number {"placeholder":"current_player_health_percent"} < {"placeholder":"getvariable","values":{"name":"prev_health_percent"}})
      └─ Set Variable Value health_flash_timer:10
      └─ Set Variable Value health_flash_alpha:1

▶ IF (Is Number getvariable:health_flash_timer > 0)
  └─ Set Variable Value health_flash_timer:{"placeholder":"maxnum","values":{"first":"0","second":{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} - 1"}}}}
  └─ Set Variable Value health_flash_alpha:{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} / 10"}}

▶ IF (Is Number getvariable:health_flash_timer = 0)
  └─ Set Variable Value prev_health_percent:{"placeholder":"current_player_health_percent"}

Why this works

  • The damage check only runs while the flash is inactive (health_flash_timer = 0), so once the timer is set to 10 it can’t immediately retrigger and reset itself.
  • The countdown and alpha update only run while the timer is above 0.
  • Only after the timer finishes do we copy the current health into prev_health_percent, so the comparison can trigger again on the next damage event.

Make sure each placeholder is inserted via the placeholder picker (no extra quotes) so FancyMenu evaluates the JSON objects instead of treating them as literal text. You can reread the Placeholders guide for the correct nesting syntax.

atomic kernel
#

with this code:

▶ IF (Is Number: {"placeholder":"current_player_health_percent"} < {"placeholder":"getvariable","values":{"name":"prev_health_percent"}})
└─ Set Variable Value: health_flash_timer:10
└─ Set Variable Value: health_flash_alpha:1

▶ IF (Is Number: {"placeholder":"getvariable","values":{"name":"health_flash_timer"}} = 0)
└─ Set Variable Value: prev_health_percent:{"placeholder":"current_player_health_percent"}

▶ Set Variable Value: health_flash_timer:{"placeholder":"maxnum","values":{"first":"0","second":"{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} - 1"}}"}}
▶ Set Variable Value: health_flash_alpha:{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} / 10"}}

the timer doesent count down until current and prev health match

#

t

frosty roverBOT
# atomic kernel with this code: ▶ IF (Is Number: {"placeholder":"current_player_health_percent"...

Because the current < prev branch keeps firing every tick, it keeps resetting the timer back to 10 before the countdown ever runs. You need to:

  1. Only trigger the damage block when the flash isn’t already running:
    IF (health_flash_timer = 0 AND current_health_percent < prev_health_percent)
      → set timer = 10
      → set alpha = 1
    
  2. Run the countdown only while the timer is above 0 (use the maxnum/calc placeholders exactly as objects—no extra quotes—so the placeholder system actually evaluates them every tick). Example:
    IF (health_flash_timer > 0)
      → health_flash_timer = max(0, health_flash_timer - 1)
      → health_flash_alpha = health_flash_timer / 10
    
  3. Update prev_health_percent only after the timer reaches 0, so the damage branch can fire again on the next hit.

That way the damage check only fires once per hit, the countdown runs each tick, and prev_health_percent only snaps to the current health after the flash finishes. Make sure you insert the placeholders via the editor UI so they stay as JSON objects—see the Placeholders guide for the exact nesting.

atomic kernel
#

it doesent work. it makes the prev health and current health match upon damage