Solved Keep Effects After Death

  • 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!

Neelix_bear

Active Member
Aug 11, 2023
215
7
18
Like The title says I Need a script that lets players keep effects after death this is what i tried and it didnt work :emoji_frowning:
Code:
on death:
    loop all potion effect on player:
        delete {potions %player%::*}
        add loop-value to {potions %player%::*}
on respawn:
    loop {potions %player%::*}:
        apply loop-value to player
 
Make sure you're formatting correct. The docs can help with this.
loop all potion effects of player
 
Make sure you're formatting correct. The docs can help with this.
loop all potion effects of player
Didnt work :emoji_frowning: heres the errors
 

Attachments

  • 2023-08-16_16.27.51.png
    2023-08-16_16.27.51.png
    53.9 KB · Views: 50
thats it ok the errors when i do stuff to fix them then DONT WORK but it doesnt have any errors after that ok?
Do you just not know english, attacker is the person who killed / damaged the victim is the one who got killed / got damaged
 
Do you just not know english, attacker is the person who killed / damaged the victim is the one who got killed / got damaged
Code:
on death:
    loop all potion effects of victim:
        delete {potions %victim%::*}
        add loop-value to {potions %victim%::*}
on respawn:
    loop {potions %player%::*}:
        apply loop-value to player
that code says it has no errors but it doesnt work!
 
Code:
on death:
    loop all potion effects of victim:
        delete {potions %victim%::*}
        add loop-value to {potions %victim%::*}
on respawn:
    loop {potions %player%::*}:
        apply loop-value to player
that code says it has no errors but it doesnt work!
Don’t add spaces to variables and u literally delete the whole list every loop
 
Code:
on death:
    loop all potion effects of victim:
        delete {potions %victim%::*}
        add loop-value to {potions %victim%::*}
on respawn:
    loop {potions %player%::*}:
        apply loop-value to player
that code says it has no errors but it doesnt work!
Your issues with this is 1) on line 3 you probably do not want to delete the entire loop (As mentioned by others, just remove it). Also 2) Your other issue with your code is that your variables have spaces in them where instead there should be periods/semi-colons (Refer to the docs on a refresher for types of variables to know what to use for your code). After you fix these issues I mentioned your code should run flawlessly.
 
Code:
on death:
    loop all potion effects of victim:
        add loop-value to {potions %victim%::*}
on respawn:
    loop {potions %player%::*}:
        apply loop-value to player
idk how to fix the variables
 
Only person who actually helped here was @Luke_Sky_Walker but i figured it out!
Code:
on death of a player:
    set {effects.%victim's uuid%::*} to victim's potion effects

on respawn:
    wait 0.1 seconds
    apply {effects.%player's uuid%::*} to player
 
  • Like
Reactions: Luke_Sky_Walker