Solved Another Error

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

MusicManSK

Active Member
Nov 30, 2017
230
11
18
Hello!
I have this piece of code:
code_language.skript:
function getVIPRank(p: player) :: text:
    set {_result} to uncoloured prefix of {_p}
    replace all "[" and "]" and "┃" in {_result} with ""
    if {_result} is "":
        set {_result} to "No VIP"
    return {_result}

every 3 seconds:
    loop all players in "spawn":
        if {chat.rank} is true:        #true: Rank | false: VIP Rank
            set score "&6&lRank" in sidebar of loop-player to 12
            set score "%getRank(loop-player)%" in sidebar of loop-player to 11
            set {chat.rank} to false
        else if {chat.rank} is false:
            set score "&6&lVIP Rank" in sidebar of loop-player to 12
            set score "%getVIPRank(loop-player)%" in sidebar of loop-player to 11
            set {chat.rank} to true
but +error:
[20:17:01 ERROR]: #!#!
[20:17:01 ERROR]: #!#! [Skript] Severe Error:
[20:17:01 ERROR]: #!#!
[20:17:01 ERROR]: #!#! Something went horribly wrong with Skript.
[20:17:01 ERROR]: #!#! This issue is NOT your fault! You probably can't fix it yourself, either.
[20:17:01 ERROR]: #!#! It looks like you are using some plugin(s) that alter how Skript works (addons).
[20:17:01 ERROR]: #!#! Following plugins are probably related to this error in some way:
[20:17:01 ERROR]: #!#! skRayFall (http://sk.rayfall.net/)
[20:17:01 ERROR]: #!#! You should try disabling those plugins one by one, trying to find which one causes it.
[20:17:01 ERROR]: #!#! If the error doesn't disappear even after disabling all listed plugins, it is probably Skript issue.
[20:17:01 ERROR]: #!#! In that case, you will be given instruction on how should you report it.
[20:17:01 ERROR]: #!#! On the other hand, if the error disappears when disabling some plugin, report it to author of that plugin.
[20:17:01 ERROR]: #!#! Only if the author tells you to do so, report it as Skript issue (url below)
[20:17:01 ERROR]: #!#! Issue tracker: https://github.com/bensku/Skript/issues (only if you know what you're doing!)
[20:17:01 ERROR]: #!#!
[20:17:01 ERROR]: #!#! Stack trace:
[20:17:01 ERROR]: #!#! java.lang.NullPointerException
[20:17:01 ERROR]: #!#! at com.gmail.thelimeglass.Scoreboards.ExprTeamPrefix.get(ExprTeamPrefix.java:42)
[20:17:01 ERROR]: #!#! at com.gmail.thelimeglass.Scoreboards.ExprTeamPrefix.get(ExprTeamPrefix.java:1)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:104)
[20:17:01 ERROR]: #!#! at ch.njol.skript.expressions.base.PropertyExpression.get(PropertyExpression.java:75)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:104)
[20:17:01 ERROR]: #!#! at ch.njol.skript.effects.EffChange.execute(EffChange.java:268)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.Effect.run(Effect.java:52)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.Trigger.execute(Trigger.java:55)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.function.ScriptFunction.execute(ScriptFunction.java:93)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.function.Function.execute(Function.java:119)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.function.FunctionReference.execute(FunctionReference.java:193)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.function.ExprFunctionCall.get(ExprFunctionCall.java:44)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:104)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.VariableString.toString(VariableString.java:440)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.VariableString.getSingle(VariableString.java:599)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.VariableString.getSingle(VariableString.java:1)
[20:17:01 ERROR]: #!#! at net.rayfall.eyesniper2.skrayfall.scoreboard.EffSetScore.execute(EffSetScore.java:46)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.Effect.run(Effect.java:52)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.Trigger.execute(Trigger.java:55)
[20:17:01 ERROR]: #!#! at ch.njol.skript.events.EvtPeriodical.execute(EvtPeriodical.java:96)
[20:17:01 ERROR]: #!#! at ch.njol.skript.events.EvtPeriodical$1.run(EvtPeriodical.java:110)
[20:17:01 ERROR]: #!#! at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftTask.run(CraftTask.java:71)
[20:17:01 ERROR]: #!#! at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:353)
[20:17:01 ERROR]: #!#! at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:738)
[20:17:01 ERROR]: #!#! at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:405)
[20:17:01 ERROR]: #!#! at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:678)
[20:17:01 ERROR]: #!#! at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:576)
[20:17:01 ERROR]: #!#! at java.lang.Thread.run(Unknown Source)
[20:17:01 ERROR]: #!#!
[20:17:01 ERROR]: #!#! Version Information:
[20:17:01 ERROR]: #!#! Skript: 2.2-dev35b (latest)
[20:17:01 ERROR]: #!#! Bukkit: 1.12-R0.1-SNAPSHOT
[20:17:01 ERROR]: #!#! Minecraft: 1.12
[20:17:01 ERROR]: #!#! Java: 1.8.0_144 (Java HotSpot(TM) 64-Bit Server VM 25.144-b01)
[20:17:01 ERROR]: #!#! OS: Windows 10 amd64 10.0
[20:17:01 ERROR]: #!#!
[20:17:01 ERROR]: #!#! Server platform: Spigot
[20:17:01 ERROR]: #!#!
[20:17:01 ERROR]: #!#! Current node: null
[20:17:01 ERROR]: #!#! Current item: set {_result}(as java.lang.Object) to uncoloured (score[ ][board]|[skellett[ ]]board) [team] prefix [(for|of)] [team] %team%
[20:17:01 ERROR]: #!#! Current trigger: function getVIPRank (simple event) (chat.sk, line -1)
[20:17:01 ERROR]: #!#!
[20:17:01 ERROR]: #!#! Thread: Server thread
[20:17:01 ERROR]: #!#!
[20:17:01 ERROR]: #!#! Language: english
[20:17:01 ERROR]: #!#! Link parse mode: DISABLED
[20:17:01 ERROR]: #!#!
[20:17:01 ERROR]: #!#! End of Error.
[20:17:01 ERROR]: #!#!
removing "uncolored" expression not working
please help
[doublepost=1527187344,1527186343][/doublepost]UPDATED CODE:
code_language.skript:
set score "%getLine(loop-player, 0)%" in sidebar of loop-player to 12
set score "%getLine(loop-player, 1)%" in sidebar of loop-player to 11


every 3 seconds:
    if {chat.rank} is true:        #true: Rank | false: VIP Rank
        set {chat.rank} to false
    else if {chat.rank} is false:
        set {chat.rank} to true
         
function getLine(p: player, l: number) :: text:    
    if {chat.rank} is true:
        if {_l} is 0:
            set {_result} to "&6&lRank"
            return {_result}
        else if {_l} is 1:
            set {_result} to "%uncolored getRank({_p})%"
            return {_result}    
    else if {chat.rank} is false:
        if {_l} is 0:
            set {_result} to "&6&lVIP Rank"
            return {_result}
        else if {_l} is 1:
            set {_result} to uncoloured prefix of {_p}
            replace all "[" and "]" and "┃" in {_result} with ""
            if {_result} is "":
                set {_result} to "Default"
            return {_result}
Error is still same but function changed to "getLine"
 
Hello!
I have this piece of code:
code_language.skript:
function getVIPRank(p: player) :: text:
    set {_result} to uncoloured prefix of {_p}
    replace all "[" and "]" and "┃" in {_result} with ""
    if {_result} is "":
        set {_result} to "No VIP"
    return {_result}

every 3 seconds:
    loop all players in "spawn":
        if {chat.rank} is true:        #true: Rank | false: VIP Rank
            set score "&6&lRank" in sidebar of loop-player to 12
            set score "%getRank(loop-player)%" in sidebar of loop-player to 11
            set {chat.rank} to false
        else if {chat.rank} is false:
            set score "&6&lVIP Rank" in sidebar of loop-player to 12
            set score "%getVIPRank(loop-player)%" in sidebar of loop-player to 11
            set {chat.rank} to true
but +error:
[20:17:01 ERROR]: #!#!
[20:17:01 ERROR]: #!#! [Skript] Severe Error:
[20:17:01 ERROR]: #!#!
[20:17:01 ERROR]: #!#! Something went horribly wrong with Skript.
[20:17:01 ERROR]: #!#! This issue is NOT your fault! You probably can't fix it yourself, either.
[20:17:01 ERROR]: #!#! It looks like you are using some plugin(s) that alter how Skript works (addons).
[20:17:01 ERROR]: #!#! Following plugins are probably related to this error in some way:
[20:17:01 ERROR]: #!#! skRayFall (http://sk.rayfall.net/)
[20:17:01 ERROR]: #!#! You should try disabling those plugins one by one, trying to find which one causes it.
[20:17:01 ERROR]: #!#! If the error doesn't disappear even after disabling all listed plugins, it is probably Skript issue.
[20:17:01 ERROR]: #!#! In that case, you will be given instruction on how should you report it.
[20:17:01 ERROR]: #!#! On the other hand, if the error disappears when disabling some plugin, report it to author of that plugin.
[20:17:01 ERROR]: #!#! Only if the author tells you to do so, report it as Skript issue (url below)
[20:17:01 ERROR]: #!#! Issue tracker: https://github.com/bensku/Skript/issues (only if you know what you're doing!)
[20:17:01 ERROR]: #!#!
[20:17:01 ERROR]: #!#! Stack trace:
[20:17:01 ERROR]: #!#! java.lang.NullPointerException
[20:17:01 ERROR]: #!#! at com.gmail.thelimeglass.Scoreboards.ExprTeamPrefix.get(ExprTeamPrefix.java:42)
[20:17:01 ERROR]: #!#! at com.gmail.thelimeglass.Scoreboards.ExprTeamPrefix.get(ExprTeamPrefix.java:1)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:104)
[20:17:01 ERROR]: #!#! at ch.njol.skript.expressions.base.PropertyExpression.get(PropertyExpression.java:75)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:104)
[20:17:01 ERROR]: #!#! at ch.njol.skript.effects.EffChange.execute(EffChange.java:268)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.Effect.run(Effect.java:52)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.Trigger.execute(Trigger.java:55)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.function.ScriptFunction.execute(ScriptFunction.java:93)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.function.Function.execute(Function.java:119)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.function.FunctionReference.execute(FunctionReference.java:193)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.function.ExprFunctionCall.get(ExprFunctionCall.java:44)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:104)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.VariableString.toString(VariableString.java:440)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.VariableString.getSingle(VariableString.java:599)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.VariableString.getSingle(VariableString.java:1)
[20:17:01 ERROR]: #!#! at net.rayfall.eyesniper2.skrayfall.scoreboard.EffSetScore.execute(EffSetScore.java:46)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.Effect.run(Effect.java:52)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89)
[20:17:01 ERROR]: #!#! at ch.njol.skript.lang.Trigger.execute(Trigger.java:55)
[20:17:01 ERROR]: #!#! at ch.njol.skript.events.EvtPeriodical.execute(EvtPeriodical.java:96)
[20:17:01 ERROR]: #!#! at ch.njol.skript.events.EvtPeriodical$1.run(EvtPeriodical.java:110)
[20:17:01 ERROR]: #!#! at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftTask.run(CraftTask.java:71)
[20:17:01 ERROR]: #!#! at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:353)
[20:17:01 ERROR]: #!#! at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:738)
[20:17:01 ERROR]: #!#! at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:405)
[20:17:01 ERROR]: #!#! at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:678)
[20:17:01 ERROR]: #!#! at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:576)
[20:17:01 ERROR]: #!#! at java.lang.Thread.run(Unknown Source)
[20:17:01 ERROR]: #!#!
[20:17:01 ERROR]: #!#! Version Information:
[20:17:01 ERROR]: #!#! Skript: 2.2-dev35b (latest)
[20:17:01 ERROR]: #!#! Bukkit: 1.12-R0.1-SNAPSHOT
[20:17:01 ERROR]: #!#! Minecraft: 1.12
[20:17:01 ERROR]: #!#! Java: 1.8.0_144 (Java HotSpot(TM) 64-Bit Server VM 25.144-b01)
[20:17:01 ERROR]: #!#! OS: Windows 10 amd64 10.0
[20:17:01 ERROR]: #!#!
[20:17:01 ERROR]: #!#! Server platform: Spigot
[20:17:01 ERROR]: #!#!
[20:17:01 ERROR]: #!#! Current node: null
[20:17:01 ERROR]: #!#! Current item: set {_result}(as java.lang.Object) to uncoloured (score[ ][board]|[skellett[ ]]board) [team] prefix [(for|of)] [team] %team%
[20:17:01 ERROR]: #!#! Current trigger: function getVIPRank (simple event) (chat.sk, line -1)
[20:17:01 ERROR]: #!#!
[20:17:01 ERROR]: #!#! Thread: Server thread
[20:17:01 ERROR]: #!#!
[20:17:01 ERROR]: #!#! Language: english
[20:17:01 ERROR]: #!#! Link parse mode: DISABLED
[20:17:01 ERROR]: #!#!
[20:17:01 ERROR]: #!#! End of Error.
[20:17:01 ERROR]: #!#!
removing "uncolored" expression not working
please help
[doublepost=1527187344,1527186343][/doublepost]UPDATED CODE:
code_language.skript:
set score "%getLine(loop-player, 0)%" in sidebar of loop-player to 12
set score "%getLine(loop-player, 1)%" in sidebar of loop-player to 11


every 3 seconds:
    if {chat.rank} is true:        #true: Rank | false: VIP Rank
        set {chat.rank} to false
    else if {chat.rank} is false:
        set {chat.rank} to true
        
function getLine(p: player, l: number) :: text:   
    if {chat.rank} is true:
        if {_l} is 0:
            set {_result} to "&6&lRank"
            return {_result}
        else if {_l} is 1:
            set {_result} to "%uncolored getRank({_p})%"
            return {_result}   
    else if {chat.rank} is false:
        if {_l} is 0:
            set {_result} to "&6&lVIP Rank"
            return {_result}
        else if {_l} is 1:
            set {_result} to uncoloured prefix of {_p}
            replace all "[" and "]" and "┃" in {_result} with ""
            if {_result} is "":
                set {_result} to "Default"
            return {_result}
Error is still same but function changed to "getLine"

I don't know if I got this correctly but try: "%uncoloured prefix of {_p}%"
 
Hmm.. Im not at pc now but im sure that it wont work beacuse its "prefix of player" and displayname is parsed as text so it shouldnt work..
 
FIXED:

code_language.skript:
function getLine(p: player, l: number) :: text:       
    if {chat.rank} is true:
        if {_l} is 0:
            set {_result} to "&6&lRank"
            return {_result}
        else if {_l} is 1:
            set {_result} to "%uncolored getRank({_p})%"
            return {_result}       
    else if {chat.rank} is false:
        if {_l} is 0:
            set {_result} to "&6&lVIP Rank"
            return {_result}
        else if {_l} is 1:
            loop players in "spawn":
                if loop-player is {_p}:
                    set {_result} to uncoloured prefix of loop-player
                    replace all "[" and "]" and "┃" in {_result} with ""
                    if {_result} is "":
                        set {_result} to "Default"
            return {_result}
 
Status
Not open for further replies.