Stop Player's Particles

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

Status
Not open for further replies.

LoneElf

Active Member
Apr 30, 2017
165
2
18
24
So, I have certain particle effects that are in action for every kit. Now, once the player logs off, the particles are still in play. I tried doing the stop all particles, but it didn't seam to work. I am not sure how to fix this as I have tried for a while now. Thanks for the help in advanced!
 
code_language.skript:
command /kselect <text> <player>:
    permission: k.select
    trigger:
        if arg 1 is "sman":
            if arg 2 is set:
                set {kit.archer.%arg 2%} to false
                set {kit.gardener.%arg 2%} to false
                set {kit.rouge.%arg 2%} to false
                set {kit.sman.%arg 2%} to true
                set {kit.pyro.%arg 2%} to false
                set {kit.elf.%arg 2%} to false
                set {kit.ninja.%arg 2%} to false
                set {kit.tank.%arg 2%} to false
                set {kit.bunny.%arg 2%} to false
                set {kit.prisoner.%arg 2%} to false
                set {kit.miner.%arg 2%} to false
                set {kit.trojan.%arg 2%} to false
                set {kit.knight.%arg 2%} to false
                clear arg 2's inventory
                message "&8[&b×&8] &7You have received Swordsman Kit!" to arg 2
                set slot 0 of arg 2 to iron_sword named "&b&lSWORDSMAN"
                set slot 1 of arg 2 to 1 golden_apple named "&b&lSWORDSMAN"
                set slot 2 of arg 2 to 2 dye:1 named "&a&l+2 HP"
                set helmet of arg 2 to iron_helmet named "&b&lSWORDSMAN"
                set chestplate of arg 2 to chain_chestplate named "&b&lSWORDSMAN"
                set leggings of arg 2 to chain_leggings named "&b&lSWORDSMAN"
                set boots of arg 2 to iron_boots named "&b&lSWORDSMAN"
                make console execute command "effect %arg 2% clear"
                while {kit.sman.%arg 2%} is true:
                    set {location.%arg 2%} to location of arg 2
                    drawDot count 1, particle "crit", center {location.%arg 2%}, visibleRange 32, keepFor 1 second
                    wait 2 ticks
code_language.skript:
on quit:
        set quit message to "&8[&b&lQUIT&8] &7%player%"
        stop all particle effects

Error on quit:
code_language.skript:
[17:16:40 WARN]: [skDragon] Task #10285017 for skDragon v0.14.0 generated an exception
java.lang.NullPointerException
[17:16:40 WARN]: [skDragon] Task #10285014 for skDragon v0.14.0 generated an exception
java.lang.NullPointerException
[17:16:41 WARN]: [skDragon] Task #10285023 for skDragon v0.14.0 generated an exception
java.lang.NullPointerException
[17:16:41 WARN]: [skDragon] Task #10285026 for skDragon v0.14.0 generated an exception
java.lang.NullPointerException
[17:16:41 WARN]: [skDragon] Task #10285036 for skDragon v0.14.0 generated an exception
java.lang.NullPointerException
[17:16:41 WARN]: [skDragon] Task #10285033 for skDragon v0.14.0 generated an exception
java.lang.NullPointerException
[17:16:41 WARN]: [skDragon] Task #10285045 for skDragon v0.14.0 generated an exception
java.lang.NullPointerException
[17:16:41 WARN]: [skDragon] Task #10285042 for skDragon v0.14.0 generated an exception
java.lang.NullPointerException
[17:16:41 WARN]: [skDragon] Task #10285052 for skDragon v0.14.0 generated an exception
java.lang.NullPointerException
[17:16:41 WARN]: [skDragon] Task #10285055 for skDragon v0.14.0 generated an exception
java.lang.NullPointerException
[17:16:41 WARN]: [skDragon] Task #10285061 for skDragon v0.14.0 generated an exception
java.lang.NullPointerException
[17:16:41 WARN]: [skDragon] Task #10285064 for skDragon v0.14.0 generated an exception
java.lang.NullPointerException
[17:16:41 WARN]: [skDragon] Task #10285070 for skDragon v0.14.0 generated an exception
java.lang.NullPointerException
[17:16:41 WARN]: [skDragon] Task #10285073 for skDragon v0.14.0 generated an exception
java.lang.NullPointerException
[17:16:41 WARN]: [skDragon] Task #10285079 for skDragon v0.14.0 generated an exception
java.lang.NullPointerException
[17:16:41 WARN]: [skDragon] Task #10285082 for skDragon v0.14.0 generated an exception
java.lang.NullPointerException
[17:16:41 WARN]: [skDragon] Task #10285091 for skDragon v0.14.0 generated an exception
java.lang.NullPointerException
[17:16:41 WARN]: [skDragon] Task #10285088 for skDragon v0.14.0 generated an exception
java.lang.NullPointerException
[17:16:41 WARN]: [skDragon] Task #10285100 for skDragon v0.14.0 generated an exception
java.lang.NullPointerException
[17:16:41 WARN]: [skDragon] Task #10285097 for skDragon v0.14.0 generated an exception
java.lang.NullPointerException

After they leave, their particles are still there. Thanks for the help! :emoji_slight_smile:
 
just replace the while {var} is true to while arg-2 is online. Then add a condition checking if the var is true. Otherwise, idk because you'll probs have to rework the code.
 
Status
Not open for further replies.