1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved how to use Function(%player%)

Discussion in 'Skript' started by IsntZ, Jun 15, 2022.

Tags:
Thread Status:
Not open for further replies.
  1. IsntZ

    IsntZ Member

    Joined:
    Jun 15, 2022
    Messages:
    23
    Likes Received:
    0
    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}
     
  2. BaeFell

    BaeFell I'm Poppy
    Admin

    Joined:
    Nov 27, 2016
    Messages:
    935
    Likes Received:
    228
    Code (Text):
    1.  
    2. function example(player: player):
    3.   send "hi there!" to {_player}
    4.  
    5. on inventory click:
    6.   example(player)
    7.  
     
  3. IsntZ

    IsntZ Member

    Joined:
    Jun 15, 2022
    Messages:
    23
    Likes Received:
    0
    Thanks it is working perfectly
     
Thread Status:
Not open for further replies.

Share This Page

Loading...