Solved how to use Function(%player%)

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

IsntZ

Member
Jun 15, 2022
23
0
1
24
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}
 
Code:
function example(player: player):
  send "hi there!" to {_player}

on inventory click:
  example(player)
 
Status
Not open for further replies.