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!

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

Solved Friend GUI

Discussion in 'Requests' started by iJDuhb, Mar 23, 2017.

  1. iJDuhb

    iJDuhb Active Member

    Joined:
    Mar 14, 2017
    Messages:
    54
    Likes Received:
    0
    Category:
    miscellaneous
    Suggested name: friendgui

    What I want:
    I have a friend skript I just need a gui where if you were to add and friend it would add it to {friends.%player%::*}
    so I was wondering if you could make it so it goes into the gui and it would be 1 after another head if you have multiple friends.


    Ideas for commands:
    /friendgui - Open gui


    Ideas for permissions:
    None


    When I'd like it by: within couple days
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    I hope i understand you, you have already a friend system, you need just only gui? There you got...

    Code (Skript):
    1. command /friend:
    2.     trigger:
    3.         open chest with 6 rows named "&6Friend GUI" to player
    4.         loop {friends.%player%::*}:
    5.             set slot loop-number -1 of player's current inventory to ("%loop-value%" parsed as offline player)'s skull named "%loop-value%"
    6.            
    7.            
    8. on inventory click:
    9.     if name of player's current inventory is "&6Friend GUI":
    10.         cancel event
     
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    There's no loop that matches 'loop-number ' (FriendParty.sk, line 39: set slot loop-number -1 of player's current inventory to ("%loop-value%" parsed as offline player)'s skull named "%loop-value%"')
    Can't compare 'name of player's current inventory' with a text (FriendParty.sk, line 43: if name of player's current inventory is "&6Friend GUI":')
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Code (Skript):
    1. command /friend:
    2.     trigger:
    3.         open chest with 6 rows named "&6Friend GUI" to player
    4.         set {_slot} to 0
    5.         loop {friends.%player%::*}:
    6.             set slot {_slot} of player's current inventory to ("%loop-value%" parsed as offline player)'s skull named "%loop-value%"
    7.             add 1 to {_slot}
    8.          
    9.          
    10. on inventory click:
    11.     if name of player's current inventory is "&6Friend GUI":
    12.         cancel event
    Simple fix. Note that if the size of the friends list variable is too high, the skulls will start to show in your inventory.
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    is there anyway to make it have a lore and show what world the person is in?
     
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Code (Skript):
    1. command /friend:
    2.     trigger:
    3.         open chest with 6 rows named "&6Friend GUI" to player
    4.         set {_s} to 0
    5.         loop {friends.%player%::*}:
    6.             set {_T} to "%loop-value%" parsed as offline player
    7.             if {_T} is online:
    8.                 set {_a} to "&a&lONLINE"
    9.                 set {_w} to "&e%{_t}'s world%" #If error, please remove the "'s"
    10.             else:
    11.                 set {_a} to "&c&lOFFLINE"
    12.                 set {_w} to "&cUnknow"
    13.             set slot {_s} of player's current inventory to {_T}'s skull named "%{_a}%" with lore "&e%{_t}%||&6World: %{_w}%"
    14.             add 1 to {_s}
    15.          
    16. on inventory click:
    17.     if inventory name of player's current inventory is "&6Friend GUI":
    18.         cancel event
     
  7. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Ok thanks haven't tested it yet but when I do I'll tell you, also when I put the if name of players current inventory it gives me error I can tell you the error tommorow
    if you need it
     
  8. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Have update the Code again. Should now fix the error with the "if name of player's current inventory"
     
  9. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Ok I will test tommorow as I'm going to bed.
    --- Double Post Merged, Mar 25, 2017, Original Post Date: Mar 24, 2017 ---
    Ok bit late, but it is working like I want it! thanks (marked as solved)
     

Share This Page

Loading...