ERROR LOG:
MY CODE:
Anyone have the fixed one?
Code:
> [09:37:56 ERROR]: Could not pass event InventoryClickEvent to Skript v2.4-beta9
java.lang.NullPointerException
at ch.njol.skript.lang.function.Function.execute(Function.java:118) ~[?:?]
at com.github.tukenuke.tuske.util.EvalFunction.run(EvalFunction.java:101) ~[?:?]
at com.github.tukenuke.tuske.manager.gui.GUI.run(GUI.java:29) ~[?:?]
at com.github.tukenuke.tuske.manager.gui.GUIManager$1.onClick(GUIManager.java:149) ~[?:?]
at com.github.tukenuke.tuske.listeners.GUIListener.onEvent(GUIListener.java:57) ~[?:?]
at com.github.tukenuke.tuske.manager.gui.v2.SkriptGUIEvent.check(SkriptGUIEvent.java:39) ~[?:?]
at ch.njol.skript.SkriptEventHandler.check(SkriptEventHandler.java:150) ~[?:?]
at ch.njol.skript.SkriptEventHandler$1.execute(SkriptEventHandler.java:114) ~[?:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:78) ~[patched_1.11.2.jar:git-Paper-1104]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[patched_1.11.2.jar:git-Paper-1104]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:517) ~[patched_1.11.2.jar:git-Paper-1104]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:502) ~[patched_1.11.2.jar:git-Paper-1104]
at net.minecraft.server.v1_11_R1.PlayerConnection.a(PlayerConnection.java:1898) ~[patched_1.11.2.jar:git-Paper-1104]
at net.minecraft.server.v1_11_R1.PacketPlayInWindowClick.a(SourceFile:33) ~[patched_1.11.2.jar:git-Paper-1104]
at net.minecraft.server.v1_11_R1.PacketPlayInWindowClick.a(SourceFile:10) ~[patched_1.11.2.jar:git-Paper-1104]
at net.minecraft.server.v1_11_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:14) ~[patched_1.11.2.jar:git-Paper-1104]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_212]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_212]
at net.minecraft.server.v1_11_R1.SystemUtils.a(SourceFile:46) [patched_1.11.2.jar:git-Paper-1104]
at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java:839) [patched_1.11.2.jar:git-Paper-1104]
at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:403) [patched_1.11.2.jar:git-Paper-1104]
at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:763) [patched_1.11.2.jar:git-Paper-1104]
at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:661) [patched_1.11.2.jar:git-Paper-1104]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
MY CODE:
Code:
options:
cooldown_message: "&4&l>>> &cWait a few seconds!"
command /shop-armor-18 [<text>] [<player>]:
trigger:
if arg 1 is not set:
if {armorShop.cooldown::%player%} is set:
send {@cooldown_message} to player
stop
else:
open chest with 1 row named "&aArmor shop" for player
format gui slot 0 of player with iron chestplate named "&cKnight armor" to run function knightGui(player)
set {armorShop.cooldown::%player%} to true
wait 3 seconds
delete {armorShop.cooldown::%player%}
function knightGui(p: player):
open chest with 1 row named "&aArmor shop &2> Knight armor" for {_p}
format gui slot 0 of {_p} with iron helmet named "&aKnight helmet" with lore "&bPrice: &7$100,000" to run function knight(player, helmet)
format gui slot 1 of {_p} with iron chestplate named "&aKnight chestplate" with lore "&bPrice: &7$140,000" to run function knight(player, chestplate)
format gui slot 2 of {_p} with iron leggings named "&aKnight leggings" with lore "&bPrice: &7$120,000" to run function knight(player, leggings)
format gui slot 3 of {_p} with iron boots named "&aKnight boots" with lore "&bPrice: &7$80,000" to run function knight(player, boots)
format gui slot 8 of {_p} with bed named "&cGo back" to run console command "/sudo %{_p}% shop-armor-18"
function tee(ps: player):
send "tee" to {_ps}
function knight(p: Player, tems: String):
if {_tems} is "helmet":
if {_p}'s balance is greater than or equal to 100000:
subtract 100000 from {_p}'s balance
add a iron helmet named "&fKnight helmet" with lore "&8ID: knight_helmet" to {_p}'s inventory
send "&2&l>>> &aYou just purchased &2(1x Knight helmet)&a!" to {_p}
else:
send "&4&l>>> &cYou don't have enough money!" to {_p}
stop
else if {_tems} is "chestplate":
if {_p}'s balance is greater than or equal to 140000:
subtract 140000 from {_p}'s balance
add a iron chestplate named "&fKnight chestplate" with lore "&8ID: knight_chestplate" to {_p}'s inventory
send "&2&l>>> &aYou just purchased &2(1x Knight chestplate)&a!" to {_p}
else:
send "&4&l>>> &cYou don't have enough money!" to {_p}
stop
else if {_tems} is "leggings":
if {_p}'s balance is greater than or equal to 120000:
subtract 120000 from {_p}'s balance
add a iron leggings named "&fKnight leggings" with lore "&8ID: knight_leggings" to {_p}'s inventory
send "&2&l>>> &aYou just purchased &2(1x Knight leggings)&a!" to {_p}
else:
send "&4&l>>> &cYou don't have enough money!" to {_p}
stop
else if {_tems} is "boots":
if {_p}'s balance is greater than or equal to 80000:
subtract 80000 from {_p}'s balance
add a iron boots named "&fKnight boots" with lore "&8ID: knight_boots" to {_p}'s inventory
send "&2&l>>> &aYou just purchased &2(1x Knight boots)&a!" to {_p}
else:
send "&4&l>>> &cYou don't have enough money!" to {_p}
stop
Anyone have the fixed one?