Solved Limit effects

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

    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!

Status
Not open for further replies.

WiebeHero

Active Member
Aug 23, 2017
135
5
0
So hello im WiebeHero, so i have been working on custom enchants but i encountered a bit of a problem i want to limit the effect to some socond limit here is the code now:

on damage:
attacker is a player
chance of 100%
if the 1st line of lore of attacker's held item contains "&7Wither I":
apply wither 1 to victim for 6 seconds
#lore1,1

So it keeps stacking up the seconds but i just want it to reset to 6 seconds can anyone help with this?
Thanks!
 
So hello im WiebeHero, so i have been working on custom enchants but i encountered a bit of a problem i want to limit the effect to some socond limit here is the code now:

on damage:
attacker is a player
chance of 100%
if the 1st line of lore of attacker's held item contains "&7Wither I":
apply wither 1 to victim for 6 seconds
#lore1,1

So it keeps stacking up the seconds but i just want it to reset to 6 seconds can anyone help with this?
Thanks!

code_language.skript:
on damage:
    attacker is a player
    chance of 100%
    if the 1st line of lore of attacker's held item contains "&7Wither I":
        remove wither 1 from the victim
        apply wither 1 to victim for 6 seconds
        #lore1,1
 
code_language.skript:
on damage:
    attacker is a player
    chance of 100%
    if the 1st line of lore of attacker's held item contains "&7Wither I":
        remove wither 1 from the victim
        apply wither 1 to victim for 6 seconds
        #lore1,1
Why remove the effect when you can just check if the victim already has the effect?
code_language.skript:
if victim has wither:
 
ohohoho Lego_freak i like this ty so much! It really helps much appericiated.
[doublepost=1506006651,1506006130][/doublepost]Aaaaw i thought it would work lego hm probably because im in using the newest version of skript....
Letme try White's method
[doublepost=1506006804][/doublepost]Nope White's method doesnt work either sadly any more ideas? Remember im using the latest version of skript.
 
Status
Not open for further replies.