I want to make a confirmation skript an i want it to be in a function so it needs to have the player
on inventory click:
if event-inventory = (metadata tag "Rank" of player):
if index of event-slot is 0:
set {rank.%player%} to "default"
confirm(%player%)
if event-inventory = (metadata tag "Confirm" of player):
if index of event-slot is 10 or 11 or 12 or 19 or 20 or 21 or 28 or 29 or 30:
set {player.%player%}'s group to {rank.%player%}
close player's inventory
function confirm(p: player):
set metadata tag "Confirm" of {_p} to chest inventory with 5 rows named "&6&lRanks"
set slot 10 and 11 and 12 and 19 and 20 and 21 and 28 and 29 and 30 of metadata tag "Confirm" of {_p} to light green wool block named "&a&lConfirm"
set slot 14 and 15 and 16 and 23 and 24 and 25 and 32 and 33 and 34 of metadata tag "Confirm" of {_p} to red wool block named "&4&lCancel"
open (metadata tag "Confirm" of {_p}) to {_p}
on inventory click:
if event-inventory = (metadata tag "Rank" of player):
if index of event-slot is 0:
set {rank.%player%} to "default"
confirm(%player%)
if event-inventory = (metadata tag "Confirm" of player):
if index of event-slot is 10 or 11 or 12 or 19 or 20 or 21 or 28 or 29 or 30:
set {player.%player%}'s group to {rank.%player%}
close player's inventory
function confirm(p: player):
set metadata tag "Confirm" of {_p} to chest inventory with 5 rows named "&6&lRanks"
set slot 10 and 11 and 12 and 19 and 20 and 21 and 28 and 29 and 30 of metadata tag "Confirm" of {_p} to light green wool block named "&a&lConfirm"
set slot 14 and 15 and 16 and 23 and 24 and 25 and 32 and 33 and 34 of metadata tag "Confirm" of {_p} to red wool block named "&4&lCancel"
open (metadata tag "Confirm" of {_p}) to {_p}