Solved Functions

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

Aleehx_

Member
Aug 9, 2021
2
0
1
38
function provaFunzione(p: player , s: slot , i: item):
if inventory name of current inventory of {_p} is {@inv-name}:
if name of {_i} is "{@slot1}":
if slot {_s} of {_p} is not air:
if {_p} have diamond pickaxe:
cancel event
send "{@slot-full}" to {_p}
play sound "{@error-sound}" with volume {@volume3} with pitch {@pitch3} at {_p} for {_p}
if slot {_s} of {_p} is air:
loop all items in {_p}'s inventory:
if loop-item is diamond pickaxe:
set {picck} to loop-item
remove {picck} from {_p}'s inventory
set slot {_s} of {_p} to {picck}
play sound "{@sel-slot-sound}" with volume {@volume2} with pitch {@pitch2} at {_p} for {_p}
cancel event
if {_p} doesn't have diamond pickaxe:
cancel event
send "{@no-pick}" to {_p}
play sound "{@error-sound}" with volume {@volume3} with pitch {@pitch3} at {_p} for {_p}


on inventory click:
provaFunzione(player , 0 , event-item)


I created this code with a function, only when I reload the skript it tells me that it is not possible to use the cancel event in the function, can anyone help me?
 
Status
Not open for further replies.