Problem with "remove loop"

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

Bartusiak

Member
Feb 5, 2017
2
0
0
123
Hi !
I have problem . I do event and I created small script with top10 the best event players (sry for my grama :emoji_wink: ).
All good worked, but day one , when I would check the top players, I had and have error.


code_language.skript:
[22:45:18] [Server thread/ERROR]: #!#!
[22:45:18] [Server thread/ERROR]: #!#! [Skript] Severe Error:
[22:45:18] [Server thread/ERROR]: #!#!
[22:45:18] [Server thread/ERROR]: #!#! If you're developing an add-on for Skript this likely means that you have done something wrong.
[22:45:18] [Server thread/ERROR]: #!#! If you're a server admin however please go to https://github.com/bensku/Skript/issues/
[22:45:18] [Server thread/ERROR]: #!#! and check whether this error has already been reported.
[22:45:18] [Server thread/ERROR]: #!#! If not please create a new ticket with a meaningful title, copy & paste this whole error into it (or use paste service),
[22:45:18] [Server thread/ERROR]: #!#! and describe what you did before it happened and/or what you think caused the error.
[22:45:18] [Server thread/ERROR]: #!#! If you think that it's a trigger that's causing the error please post the trigger as well.
[22:45:18] [Server thread/ERROR]: #!#! By following this guide fixing the error should be easy and done fast.
[22:45:18] [Server thread/ERROR]: #!#!
[22:45:18] [Server thread/ERROR]: #!#! Stack trace:
[22:45:18] [Server thread/ERROR]: #!#! java.lang.NullPointerException
[22:45:18] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Variable.setIndex(Variable.java:377)
[22:45:18] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Variable.change(Variable.java:456)
[22:45:18] [Server thread/ERROR]: #!#!     at ch.njol.skript.effects.EffChange.execute(EffChange.java:273)
[22:45:18] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Effect.run(Effect.java:54)
[22:45:18] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:65)
[22:45:18] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:93)
[22:45:18] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Trigger.execute(Trigger.java:53)
[22:45:18] [Server thread/ERROR]: #!#!     at ch.njol.skript.command.ScriptCommand.execute2(ScriptCommand.java:222)
[22:45:18] [Server thread/ERROR]: #!#!     at ch.njol.skript.command.ScriptCommand.execute(ScriptCommand.java:184)
[22:45:18] [Server thread/ERROR]: #!#!     at ch.njol.skript.command.Commands.handleCommand(Commands.java:270)
[22:45:18] [Server thread/ERROR]: #!#!     at ch.njol.skript.command.Commands$1.onServerCommand(Commands.java:181)
[22:45:18] [Server thread/ERROR]: #!#!     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[22:45:18] [Server thread/ERROR]: #!#!     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[22:45:18] [Server thread/ERROR]: #!#!     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[22:45:18] [Server thread/ERROR]: #!#!     at java.lang.reflect.Method.invoke(Method.java:498)
[22:45:18] [Server thread/ERROR]: #!#!     at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302)
[22:45:18] [Server thread/ERROR]: #!#!     at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
[22:45:18] [Server thread/ERROR]: #!#!     at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502)
[22:45:18] [Server thread/ERROR]: #!#!     at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487)
[22:45:18] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_11_R1.DedicatedServer.aM(DedicatedServer.java:432)
[22:45:18] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:400)
[22:45:18] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:675)
[22:45:18] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:574)
[22:45:18] [Server thread/ERROR]: #!#!     at java.lang.Thread.run(Thread.java:745)
[22:45:18] [Server thread/ERROR]: #!#!
[22:45:18] [Server thread/ERROR]: #!#! Version Information:
[22:45:18] [Server thread/ERROR]: #!#!   Skript: 2.2-dev23
[22:45:18] [Server thread/ERROR]: #!#!   Bukkit: 1.11.2-R0.1-SNAPSHOT
[22:45:18] [Server thread/ERROR]: #!#!   Minecraft: 1.11.2
[22:45:18] [Server thread/ERROR]: #!#!   Java: 1.8.0_111 (Java HotSpot(TM) 64-Bit Server VM 25.111-b14)
[22:45:18] [Server thread/ERROR]: #!#!   OS: Linux amd64 3.2.0-4-amd64
[22:45:18] [Server thread/ERROR]: #!#!
[22:45:18] [Server thread/ERROR]: #!#! Running CraftBukkit: false
[22:45:18] [Server thread/ERROR]: #!#!
[22:45:18] [Server thread/ERROR]: #!#! Current node: null
[22:45:18] [Server thread/ERROR]: #!#! Current item: remove {_v.%loop-number%}(as java.lang.Object) from {licznik::*}(as java.lang.Object)
[22:45:18] [Server thread/ERROR]: #!#!
[22:45:18] [Server thread/ERROR]: #!#! Thread: Server thread
[22:45:18] [Server thread/ERROR]: #!#!
[22:45:18] [Server thread/ERROR]: #!#! End of Error.
[22:45:18] [Server thread/ERROR]: #!#!

I updated SkQuery, skript for spigot 1.11.2, but I have the same problem.
I think that, I crossed secured number and all crashed myself.

King Regards,
Bartusiak/Magnum
 
Sure, my code:

code_language.skript:
#Event By Magnum
#Ver 1.0

variables:
    {licznik::%player%} = 0
on join:
    if {licznik::%player%} is not set:
        set {licznik::%player%} to 0
command /top10:
    permission: skript.topevent
    permission message: &6NIE MASZ UPRAWNIEN ! &5<3
    description: Top 10 graczy z najwyzsza iloscia punktow
    trigger:
        send  "&c| &6------------------------------- &c|"
        send  "&c| &dTOP 10 NAJLEPSZYCH GRACZY EVENTU: &c|"
        send  "&c| &6------------------------------- &c|"
        set {_num} to size of {licznik::*}
        loop {_num} times:
            loop {licznik::*}:
                {_v.%loop-number%} is not set:
                    set {_v.%loop-number%} to loop-value-2
                    set {_naz.%loop-number%} to loop-index
                loop-value-2 is greater than {_v.%loop-number%}:
                    set {_v.%loop-number%} to loop-value-2
                    set {_naz.%loop-number%} to loop-index
            remove {_v.%loop-number%} from {licznik::*}
        loop {_num} times:
            if loop-number is less than or equal to 10:
                send " &b%loop-number%. &a%{_naz.%loop-number%}%  &8(&6&o%{_v.%loop-number%}%&8) "
            set {licznik::%{_naz.%loop-number%}%} to {_v.%loop-number%}
        send  "&c| &6------------------------------- &c|"
 
Status
Not open for further replies.