functions not working when using on right click:

  • 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 community!

    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.

ROOT BEER

Member
Jun 14, 2021
3
0
1
code:

function crate(p: player):
remove 1 of {crate.red.key} from {_p}'s inventory
open virtual chest inventory with size 3 named "&c--&f== &c&lRed Crate &r&f==&c--" to {_p}
format gui slot 0 of {_p} with red glass pane named "&c&k1"
format gui slot 1 of {_p} with white glass pane named "&c&k1"
format gui slot 2 of {_p} with red glass pane named "&c&k1"
format gui slot 3 of {_p} with white glass pane named "&c&k1"
format gui slot 4 of {_p} with red glass pane named "&c&k1"
format gui slot 5 of {_p} with white glass pane named "&c&k1"
format gui slot 6 of {_p} with red glass pane named "&c&k1"
format gui slot 7 of {_p} with white glass pane named "&c&k1"
format gui slot 8 of {_p} with red glass pane named "&c&k1"
format gui slot 9 of {_p} with white glass pane named "&c&k1"
format gui slot 10 of {_p} with red glass pane named "&c&k1"
format gui slot 11 of {_p} with white glass pane named "&c&k1"
format gui slot 12 of {_p} with red glass pane named "&c&k1"
format gui slot 14 of {_p} with red glass pane named "&c&k1"
format gui slot 15 of {_p} with white glass pane named "&c&k1"
format gui slot 16 of {_p} with red glass pane named "&c&k1"
format gui slot 17 of {_p} with white glass pane named "&c&k1"
format gui slot 18 of {_p} with red glass pane named "&c&k1"
format gui slot 19 of {_p} with white glass pane named "&c&k1"
format gui slot 20 of {_p} with red glass pane named "&c&k1"
format gui slot 21 of {_p} with white glass pane named "&c&k1"
format gui slot 22 of {_p} with red glass pane named "&c&k1"
format gui slot 23 of {_p} with white glass pane named "&c&k1"
format gui slot 24 of {_p} with red glass pane named "&c&k1"
format gui slot 25 of {_p} with white glass pane named "&c&k1"
format gui slot 26 of {_p} with red glass pane named "&c&k1"
play sound "EXPLODE" at {_p} for {_p}
chance of 45%:
format gui slot 13 of {_p} with 64 diamonds named "&b64 Diamonds"
give {_p} 64 diamonds
chance of 10%:
format gui slot 13 of {_p} with 10 diamond blocks named "&b10 Diamond Blocks"
give {_p} 10 diamond blocks

command test:
trigger:
crate(player)
send "1"

on right click:
if event-block is {crate.red}:
if player's held item = {crate.red.key}:
cancel event
wait 1 tick
crate(player)
else:
cancel event
send "&4you need to be holding a &cRed &7Crate Key"
play sound "GLASS" at player for player

error:

[00:47:45 ERROR]: #!#! Version Information:
[00:47:45 ERROR]: #!#! Skript: 2.2-dev36 (custom version)
[00:47:45 ERROR]: #!#! Bukkit: 1.8.8-R0.1-SNAPSHOT
[00:47:45 ERROR]: #!#! Minecraft: 1.8.8
[00:47:45 ERROR]: #!#! Java: 1.8.0_333 (Java HotSpot(TM) Client VM 25.333-b02)
[00:47:45 ERROR]: #!#! OS: Windows 10 x86 10.0
[00:47:45 ERROR]: #!#!
[00:47:45 ERROR]: #!#! Server platform: Spigot
[00:47:45 ERROR]: #!#!
[00:47:45 ERROR]: #!#! Current node: null
[00:47:45 ERROR]: #!#! Current item: the tool of the player is equal to {crate.red.key}(as java.lang.Object) (comparator: null)
[00:47:45 ERROR]: #!#! Current trigger: right click (rightclick) (crates.sk, line 43)
[00:47:45 ERROR]: #!#!
[00:47:45 ERROR]: #!#! Thread: Server thread
[00:47:45 ERROR]: #!#!
[00:47:45 ERROR]: #!#! Language: english
[00:47:45 ERROR]: #!#! Link parse mode: DISABLED
[00:47:45 ERROR]: #!#!
[00:47:45 ERROR]: #!#! End of Error.
[00:47:45 ERROR]: #!#!

side note: it was working fine and then for some reason it just stopped working not sure why

when i use the /test command the function works but for some reason when i am doing it with the key and crate it will not work, when there is no key in my hand and i click on the crate it returns the "you need the red crate key" message but when the key is in my hand nothing happens.
 
Status
Not open for further replies.