Solved SOLVED Setting health to a variable and vice versa

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

pidgendev

Member
Nov 24, 2024
3
0
1
24
hey gang whats up. So im coding a double life plugin (Grians life series) but its linked with 4 players and not just 2. It functions by on regen and on damage it sets the variable to the players health and every tick it sets all players health on that soul link to that variable. BUT I CANT FIGURE IT OUT!!!!!!!
is this even possible?
Heres what I have now.

on damage:
wait 1 tick
if victim is on team GAP
set health of all players on team GAP to victim


(GAP is the title of one of the soulbound groups.)
 
oh ok
can you elaborate?
I literally just started scripting like 3 days ago so I am incredibly lost.
Oh ok, got it. Basically lists are like variables except they can store more than one piece of data. So a normal variable is like money and there is only one value, but a list is for things like players and loot tables. In this scenario you can use lists to store people on teams, so like {gap::*} for the team, then you would store players on it either through clearing the list and adding the team members when you load, or adding it through game. Like this:
code_language.skript:
on load:
    clear {gap::*}
    add "[team member]" parsed as player to {gap::*}
    add "[team member]" parsed as player to {gap::*}
    add "[team member]" parsed as player to {gap::*}
    add "[team member]" parsed as player to {gap::*}
    #etc for every team

OR

code_language.skript:
command /teamadd <player> <string>:
    permission: op #only for people with op
    trigger:
        add arg-1 to {%arg-2%::*}

command /teamclear <string>:
    permission: op #again for people only with op
    trigger:
        clear {%arg-2%::*}
 
oh ok

Oh ok, got it. Basically lists are like variables except they can store more than one piece of data. So a normal variable is like money and there is only one value, but a list is for things like players and loot tables. In this scenario you can use lists to store people on teams, so like {gap::*} for the team, then you would store players on it either through clearing the list and adding the team members when you load, or adding it through game. Like this:
code_language.skript:
on load:
    clear {gap::*}
    add "[team member]" parsed as player to {gap::*}
    add "[team member]" parsed as player to {gap::*}
    add "[team member]" parsed as player to {gap::*}
    add "[team member]" parsed as player to {gap::*}
    #etc for every team

OR

code_language.skript:
command /teamadd <player> <string>:
    permission: op #only for people with op
    trigger:
        add arg-1 to {%arg-2%::*}

command /teamclear <string>:
    permission: op #again for people only with op
    trigger:
        clear {%arg-2%::*}
oh thats really cool. Is there any way that when someone on a list gets damaged it can activate some sort of thing for the whole list? (In this case setting the whole lists hearts to the victims)