1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT??:

    You can always check our our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved On rightclick on sign: doesn't work

Discussion in 'Skript' started by Marsbar, Aug 12, 2019.

  1. Marsbar

    Marsbar Well-Known Member

    Joined:
    Mar 31, 2019
    Messages:
    75
    Likes Received:
    2
    Code (Text):
    1.  
    2.  
    3. on rightclick:
    4.     if line 1 of event-block is "&4&l[&c&lKøbt&4&l]":
    5.         if line 2 of event-block is "&aPris er ikke sat":
    6.             send "{@p} &cPrisen på denne celle er ikke sat endnu"
    7.             stop
    8.         if line 1 of event-block is "&2&l[&a&lFri&2&l]":
    9.             if "%uncolored line 3 of event-block%" is {cell.players.%player%}:
    10.                 set {_price} to "%line 2 of event-block%"
    11.                 replace "{@MS}" in {_price} with ""
    12.                 if player's balance is bigger or equal to {_price}:
    13.                     add 1 day to {cell.%uncolored line 3 of event-block%.time}
    14.                     remove {_price} from player's balance
    15.                     send "{@p} &aTilføjede 1 dag til din celle"
    16.                 else:
    17.                     send "{@p} &cDu har ikke nok penge"
    18.                 stop
    19.             if {Cell.Players.%player%} is set:
    20.                 send "{@p} &cDu har allerede det maksimale antal af celler"
    21.             else:
    22.                 set {_price} to "%line 2 of event-block%"
    23.                 replace "{@MS}" in {_price} with ""
    24.                 set {_bal} to player's balance
    25.                 replace all "$" in {_bal} with ""
    26.                 send "%{_bal}%"
    27.                 if player's balance is bigger than 300:#{_price}:
    28.                     set {cell.%uncolored line 3 of event-block%.lastcheck} to now
    29.                     set line 1 of event-block to "&4&l[&c&lKøbt&4&l]"
    30.                     set line 2 of event-block to "&c%Player%"
    31.                     add "%uncolored line 3 of event-block%" to {cell.bought::*}
    32.                     set line 3 of event-block to "&c%uncolored line 3 of event-block%"
    33.                     set line 4 of event-block to "&c1d"
    34.                     set {cell.players.%player%} to "%uncolored line 3 of event-block%"
    35.                     set {cell.%uncolored line 3 of event-block%.time} to 1 day
    36.                     set {cell.%uncolored line 3 of event-block%.owner} to player
    37.                     execute console command "/rg addowner %{cell.%uncolored line 3 of event-block%}% %player%"
    38.                     remove {_price} from player's balance
    39.                     set {_timeleft} to difference between {cell.lastcheck} and now
    40.                     remove {_timeleft} from {cell.%uncolored line 3 of event-block%.time}
    41.                     if true:
    42.                         if {cell.%uncolored line 3 of event-block%.time} is bigger or equal to 1 day:
    43.                             set {_m} to {cell.%uncolored line 3 of event-block%.time}
    44.                             set line 1 of {cell.%uncolored line 3 of event-block%.signcoords} to "%{_m}%"
    45.                             set {_m} to "%line 1 of {cell.%uncolored line 3 of event-block%.signcoords}%"
    46.                             replace all " days" in {_m} with "d"
    47.                             replace all " day" in {_m} with "d"
    48.                             replace all " hours" in {_m} with "h"
    49.                             replace all " hour" in {_m} with "h"
    50.                             replace all " and" in {_m} with ""
    51.                             set line 1 of {cell.%uncolored line 3 of event-block%.signcoords} to "%{_m}%"
    52.                             stop
    53.                         if {cell.%uncolored line 3 of event-block%.time} is bigger or equal to 1 hour:
    54.                             set {_m} to {cell.%uncolored line 3 of event-block%.time}
    55.                             set line 1 of {cell.%uncolored line 3 of event-block%.signcoords} to "%{_m}%"
    56.                             set {_m} to "%line 1 of {cell.%uncolored line 3 of event-block%.signcoords}%"
    57.                             replace all " hours" in {_m} with "h"
    58.                             replace all " hour" in {_m} with "h"
    59.                             replace all " minutes" in {_m} with "m"
    60.                             replace all " minute" in {_m} with "m"
    61.                             replace all " and" in {_m} with ""
    62.                             set line 1 of {cell.%uncolored line 3 of event-block%.signcoords} to "%{_m}%"
    63.                             stop
    64.                         if {cell.%uncolored line 3 of event-block%.time} is bigger or equal to 1 minute:
    65.                             set {_m} to {cell.%uncolored line 3 of event-block%.time}
    66.                             set line 1 of {cell.%uncolored line 3 of event-block%.signcoords} to "%{_m}%"
    67.                             set {_m} to "%line 1 of {cell.%uncolored line 3 of event-block%.signcoords}%"
    68.                             replace all " minutes" in {_m} with "m"
    69.                             replace all " minute" in {_m} with "m"
    70.                             replace all " seconds" in {_m} with "s"
    71.                             replace all " second" in {_m} with "s"
    72.                             replace all " and" in {_m} with ""
    73.                             set line 1 of {cell.%uncolored line 3 of event-block%.signcoords} to "%{_m}%"
    74.                             stop
    75.  
    76.                     send "{@p} &aDu købte cellen &c%uncolored line 3 of event-block%"
    77.                 else:
    78.                     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 (Text):
    1. [14:14:43] [Server thread/ERROR]: #!#! java.lang.IllegalArgumentException: Illegal group reference: group index is missing
    2. [14:14:43] [Server thread/ERROR]: #!#!     at java.util.regex.Matcher.appendReplacement(Matcher.java:819)
    3. [14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.util.StringUtils.replaceAll(StringUtils.java:88)
    4. [14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.util.StringUtils.replaceAll(StringUtils.java:68)
    5. [14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.replaceOptions(ScriptLoader.java:582)
    6. [14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadItems(ScriptLoader.java:612)
    7. [14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.TriggerSection.<init>(TriggerSection.java:55)
    8. [14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Conditional.<init>(Conditional.java:44)
    9. [14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadItems(ScriptLoader.java:701)
    10. [14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.TriggerSection.<init>(TriggerSection.java:55)
    11. [14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Conditional.<init>(Conditional.java:44)
    12. [14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadItems(ScriptLoader.java:701)
    13. [14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.TriggerSection.<init>(TriggerSection.java:55)
    14. [14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Conditional.<init>(Conditional.java:44)
    15. [14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Conditional.loadElseIf(Conditional.java:94)
    16. [14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadItems(ScriptLoader.java:689)
    17. [14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadScript(ScriptLoader.java:489)
    18. [14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:262)
    19. [14:14:43] [Server thread/ERROR]: #!#!     at ch.njol.skript.SkriptCommand.onCommand(SkriptCommand.java:155)
    20. [14:14:43] [Server thread/ERROR]: #!#!     at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
    21. [14:14:43] [Server thread/ERROR]: #!#!     at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141)
    22. [14:14:43] [Server thread/ERROR]: #!#!     at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:642)
    23. [14:14:43] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1135)
    24. [14:14:43] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:970)
    25. [14:14:43] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:45)
    26. [14:14:43] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:1)
    27. [14:14:43] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13)
    28. [14:14:43] [Server thread/ERROR]: #!#!     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    29. [14:14:43] [Server thread/ERROR]: #!#!     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    30. [14:14:43] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.SystemUtils.a(SystemUtils.java:19)
    31. [14:14:43] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:718)
    32. [14:14:43] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:367)
    33. [14:14:43] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:657)
    34. [14:14:43] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:560)
    35. [14:14:43] [Server thread/ERROR]: #!#!     at java.lang.Thread.run(Thread.java:748)
    36. [14:14:43] [Server thread/ERROR]: #!#!
    37. [14:14:43] [Server thread/ERROR]: #!#! Version Information:
    38. [14:14:43] [Server thread/ERROR]: #!#!   Skript: 2.1.2
    39. [14:14:43] [Server thread/ERROR]: #!#!   Bukkit: 1.8.7-R0.1-SNAPSHOT
    40. [14:14:43] [Server thread/ERROR]: #!#!   Minecraft: 1.8.7
    41. [14:14:43] [Server thread/ERROR]: #!#!   Java: 1.8.0_151
    42. [14:14:43] [Server thread/ERROR]: #!#!
    43. [14:14:43] [Server thread/ERROR]: #!#! Running CraftBukkit: false
    44. [14:14:43] [Server thread/ERROR]: #!#!
    45. [14:14:43] [Server thread/ERROR]: #!#! Current node: replace "{@MS}" in {_price} with "" (Celle.sk, line 151)
    46. [14:14:43] [Server thread/ERROR]: #!#! Current item: null
    47. [14:14:43] [Server thread/ERROR]: #!#!
    48. [14:14:43] [Server thread/ERROR]: #!#! Thread: Server thread
    49. [14:14:43] [Server thread/ERROR]: #!#!
    50. [14:14:43] [Server thread/ERROR]: #!#! End of Error.
    51. [14:14:43] [Server thread/ERROR]: #!#!
    52.  
    In found a solution myself
     
    #1 Marsbar, Aug 12, 2019
    Last edited: Aug 12, 2019
  2. malia

    malia Well-Known Member

    Joined:
    Jul 24, 2019
    Messages:
    271
    Likes Received:
    17
    on rightclick on sign:
     
    • Funny Funny x 1
  3. Marsbar

    Marsbar Well-Known Member

    Joined:
    Mar 31, 2019
    Messages:
    75
    Likes Received:
    2
    Ohh i have tried with that but i found a solution myself:emoji_grinning:
     
  4. L

    Joined:
    Sep 15, 2019
    Messages:
    1
    Likes Received:
    0
    What did you do marsbar
     
  5. Marsbar

    Marsbar Well-Known Member

    Joined:
    Mar 31, 2019
    Messages:
    75
    Likes Received:
    2
    Jeg kan se et dansk navn såå. Ja,der var en slags fejl. Jeg fjernede noget med replace all.. Kan jeg se din kode og din log?
     
  6. malia

    malia Well-Known Member

    Joined:
    Jul 24, 2019
    Messages:
    271
    Likes Received:
    17
    English, please.
     
  7. Marsbar

    Marsbar Well-Known Member

    Joined:
    Mar 31, 2019
    Messages:
    75
    Likes Received:
    2
    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?
     
Loading...