Solved On rightclick on sign: doesn't work

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

Marsbar

Active Member
Mar 31, 2019
131
4
18
18
Code:
on rightclick:
    if line 1 of event-block is "&4&l[&c&lKøbt&4&l]":
        if line 2 of event-block is "&aPris er ikke sat":
            send "{@p} &cPrisen på denne celle er ikke sat endnu"
            stop
        if line 1 of event-block is "&2&l[&a&lFri&2&l]":
            if "%uncolored line 3 of event-block%" is {cell.players.%player%}:
                set {_price} to "%line 2 of event-block%"
                replace "{@MS}" in {_price} with ""
                if player's balance is bigger or equal to {_price}:
                    add 1 day to {cell.%uncolored line 3 of event-block%.time}
                    remove {_price} from player's balance
                    send "{@p} &aTilføjede 1 dag til din celle"
                else:
                    send "{@p} &cDu har ikke nok penge"
                stop
            if {Cell.Players.%player%} is set:
                send "{@p} &cDu har allerede det maksimale antal af celler"
            else:
                set {_price} to "%line 2 of event-block%"
                replace "{@MS}" in {_price} with ""
                set {_bal} to player's balance
                replace all "$" in {_bal} with ""
                send "%{_bal}%"
                if player's balance is bigger than 300:#{_price}:
                    set {cell.%uncolored line 3 of event-block%.lastcheck} to now
                    set line 1 of event-block to "&4&l[&c&lKøbt&4&l]"
                    set line 2 of event-block to "&c%Player%"
                    add "%uncolored line 3 of event-block%" to {cell.bought::*}
                    set line 3 of event-block to "&c%uncolored line 3 of event-block%"
                    set line 4 of event-block to "&c1d"
                    set {cell.players.%player%} to "%uncolored line 3 of event-block%"
                    set {cell.%uncolored line 3 of event-block%.time} to 1 day
                    set {cell.%uncolored line 3 of event-block%.owner} to player
                    execute console command "/rg addowner %{cell.%uncolored line 3 of event-block%}% %player%"
                    remove {_price} from player's balance
                    set {_timeleft} to difference between {cell.lastcheck} and now
                    remove {_timeleft} from {cell.%uncolored line 3 of event-block%.time}
                    if true:
                        if {cell.%uncolored line 3 of event-block%.time} is bigger or equal to 1 day:
                            set {_m} to {cell.%uncolored line 3 of event-block%.time}
                            set line 1 of {cell.%uncolored line 3 of event-block%.signcoords} to "%{_m}%"
                            set {_m} to "%line 1 of {cell.%uncolored line 3 of event-block%.signcoords}%"
                            replace all " days" in {_m} with "d"
                            replace all " day" in {_m} with "d"
                            replace all " hours" in {_m} with "h"
                            replace all " hour" in {_m} with "h"
                            replace all " and" in {_m} with ""
                            set line 1 of {cell.%uncolored line 3 of event-block%.signcoords} to "%{_m}%"
                            stop
                        if {cell.%uncolored line 3 of event-block%.time} is bigger or equal to 1 hour:
                            set {_m} to {cell.%uncolored line 3 of event-block%.time}
                            set line 1 of {cell.%uncolored line 3 of event-block%.signcoords} to "%{_m}%"
                            set {_m} to "%line 1 of {cell.%uncolored line 3 of event-block%.signcoords}%"
                            replace all " hours" in {_m} with "h"
                            replace all " hour" in {_m} with "h"
                            replace all " minutes" in {_m} with "m"
                            replace all " minute" in {_m} with "m"
                            replace all " and" in {_m} with ""
                            set line 1 of {cell.%uncolored line 3 of event-block%.signcoords} to "%{_m}%"
                            stop
                        if {cell.%uncolored line 3 of event-block%.time} is bigger or equal to 1 minute:
                            set {_m} to {cell.%uncolored line 3 of event-block%.time}
                            set line 1 of {cell.%uncolored line 3 of event-block%.signcoords} to "%{_m}%"
                            set {_m} to "%line 1 of {cell.%uncolored line 3 of event-block%.signcoords}%"
                            replace all " minutes" in {_m} with "m"
                            replace all " minute" in {_m} with "m"
                            replace all " seconds" in {_m} with "s"
                            replace all " second" in {_m} with "s"
                            replace all " and" in {_m} with ""
                            set line 1 of {cell.%uncolored line 3 of event-block%.signcoords} to "%{_m}%"
                            stop

                    send "{@p} &aDu købte cellen &c%uncolored line 3 of event-block%"
                else:
                    send "{@p} &cDu har ikke nok penge"

I'm trying to make a cell skript and it just won't work...
The problem is 'On rightclick on sign', if i set a 'Send "Test"' it won't either send even if it is the first line of the event. If I make an error in the fifth line it works but then the important code isn't going to run. Can someone help me pls? Thank you

Edit:
I found this in my logs:
Code:
[14:14:43] [Server thread/ERROR]: #!#! java.lang.IllegalArgumentException: Illegal group reference: group index is missing
[14:14:43] [Server thread/ERROR]: #!#!     at java.util.regex.Matcher.appendReplacement(Matcher.java:819)
[14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.util.StringUtils.replaceAll(StringUtils.java:88)
[14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.util.StringUtils.replaceAll(StringUtils.java:68)
[14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.replaceOptions(ScriptLoader.java:582)
[14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadItems(ScriptLoader.java:612)
[14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.TriggerSection.<init>(TriggerSection.java:55)
[14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Conditional.<init>(Conditional.java:44)
[14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadItems(ScriptLoader.java:701)
[14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.TriggerSection.<init>(TriggerSection.java:55)
[14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Conditional.<init>(Conditional.java:44)
[14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadItems(ScriptLoader.java:701)
[14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.TriggerSection.<init>(TriggerSection.java:55)
[14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Conditional.<init>(Conditional.java:44)
[14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Conditional.loadElseIf(Conditional.java:94)
[14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadItems(ScriptLoader.java:689)
[14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadScript(ScriptLoader.java:489)
[14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:262)
[14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.SkriptCommand.onCommand(SkriptCommand.java:155)
[14:14:43] [Server thread/ERROR]: #!#!     at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
[14:14:43] [Server thread/ERROR]: #!#!     at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141)
[14:14:43] [Server thread/ERROR]: #!#!     at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:642)
[14:14:43] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1135)
[14:14:43] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:970)
[14:14:43] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:45)
[14:14:43] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:1)
[14:14:43] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13)
[14:14:43] [Server thread/ERROR]: #!#!     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[14:14:43] [Server thread/ERROR]: #!#!     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[14:14:43] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.SystemUtils.a(SystemUtils.java:19)
[14:14:43] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:718)
[14:14:43] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:367)
[14:14:43] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:657)
[14:14:43] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:560)
[14:14:43] [Server thread/ERROR]: #!#!     at java.lang.Thread.run(Thread.java:748)
[14:14:43] [Server thread/ERROR]: #!#!
[14:14:43] [Server thread/ERROR]: #!#! Version Information:
[14:14:43] [Server thread/ERROR]: #!#!   Skript: 2.1.2
[14:14:43] [Server thread/ERROR]: #!#!   Bukkit: 1.8.7-R0.1-SNAPSHOT
[14:14:43] [Server thread/ERROR]: #!#!   Minecraft: 1.8.7
[14:14:43] [Server thread/ERROR]: #!#!   Java: 1.8.0_151
[14:14:43] [Server thread/ERROR]: #!#!
[14:14:43] [Server thread/ERROR]: #!#! Running CraftBukkit: false
[14:14:43] [Server thread/ERROR]: #!#!
[14:14:43] [Server thread/ERROR]: #!#! Current node: replace "{@MS}" in {_price} with "" (Celle.sk, line 151)
[14:14:43] [Server thread/ERROR]: #!#! Current item: null
[14:14:43] [Server thread/ERROR]: #!#!
[14:14:43] [Server thread/ERROR]: #!#! Thread: Server thread
[14:14:43] [Server thread/ERROR]: #!#!
[14:14:43] [Server thread/ERROR]: #!#! End of Error.
[14:14:43] [Server thread/ERROR]: #!#!
In found a solution myself
 
Last edited:
Translation: I can see a danish name soo. There was so a kind of error.
I removed something with replace all. Can i see your code and log?
 
Status
Not open for further replies.