#tryna make a health system
1 messages · Page 1 of 1 (latest)
What is "loop set player's action bar to ..." supposed to do
Also you never need to include "the"
For anything
Also, adding an underscore to the beginning of a variable name makes it a local variable
Meaning the variable is only used in the function/event it was created in
So if in on join:, I set {_variable} to something, I can't use {_variable} in another event like on damage:
To use variables everywhere (global variables), remove the underscore
{globalvariable}
I recommend looking up a tutorial to better understand how they work in skript
just use health scaling
set player's health scale to 20
uh
you'll have to figure out the math yourself
but it shouldn't be too difficult
because most of the work is done w this
why are u looping all players
because health is a number
not a text
but skript thinks ur talking about a text
and?
then u know
use an armor change event
like a normal person

what do u mean
if they leave and rejoin
it will count as them equipping armor
but not unequpping iirc
??
on armor change:
if old armor item is a leather helmet:
So if I understand you then your trying to code a system that gives you hearts if you equip a specific item right?
I would love to help you if you could give me some context on what your trying to code exactly
Ok give me a second
on armor change: if new armor item is leather chestplate named “Special Chestplate” with lore “gives you 5 hearts”: add 5 to the max players health heal the player else if old armor item is leather chestplate named “Special Chestplate” with lore “gives you 5 hearts”: remove 5 from the max players health
Might not work since I’m on my phone rn but this should work in general
You could now add a command that sets the item and store it in a variable
Then you could replace the Chest plate part with the variable
Set it back to your original health with a command
Alr
command /reset: trigger: set scaled heath of player to 10
does that work for you?
Wdym nope
Any errors?
Then set it to 20 in the Skript
Why are you using health scale again?
Ok so could you do that
What doesn’t work exactly
Could you send me your whole code please
This is just a mess
Let me code something for you
@split valve
set {customitem} to unbreakable leather chestplate named "&cHealthplate" with lore "&fGives you 10 hearts!"
on armor change:
if new armor item is {customitem}:
add 10 to the players max health
heal the player
if old armor item is {customitem}:
remove 10 from the players max health
command /getitem:
permission: op
trigger:
give {customitem} to player```
So
I have never actually worked with health scaling before, could you try clear scaled health of player
It says it
Use reset scaled health of player
Wdym it didn’t work then
Thank god
Do you need any more help?