Solved Friend GUI

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

iJDuhb

Active Member
Mar 14, 2017
54
0
6
34
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
 
I hope i understand you, you have already a friend system, you need just only gui? There you got...

code_language.skript:
command /friend:
    trigger:
        open chest with 6 rows named "&6Friend GUI" to player
        loop {friends.%player%::*}:
            set slot loop-number -1 of player's current inventory to ("%loop-value%" parsed as offline player)'s skull named "%loop-value%"
            
            
on inventory click:
    if name of player's current inventory is "&6Friend GUI":
        cancel event
 
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":')
 
code_language.skript:
command /friend:
    trigger:
        open chest with 6 rows named "&6Friend GUI" to player
        set {_slot} to 0
        loop {friends.%player%::*}:
            set slot {_slot} of player's current inventory to ("%loop-value%" parsed as offline player)'s skull named "%loop-value%"
            add 1 to {_slot}
          
          
on inventory click:
    if name of player's current inventory is "&6Friend GUI":
        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.
 
code_language.skript:
command /friend:
    trigger:
        open chest with 6 rows named "&6Friend GUI" to player
        set {_slot} to 0
        loop {friends.%player%::*}:
            set slot {_slot} of player's current inventory to ("%loop-value%" parsed as offline player)'s skull named "%loop-value%"
            add 1 to {_slot}
         
         
on inventory click:
    if name of player's current inventory is "&6Friend GUI":
        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.

is there anyway to make it have a lore and show what world the person is in?
 
code_language.skript:
command /friend:
    trigger:
        open chest with 6 rows named "&6Friend GUI" to player
        set {_s} to 0
        loop {friends.%player%::*}:
            set {_T} to "%loop-value%" parsed as offline player
            if {_T} is online:
                set {_a} to "&a&lONLINE"
                set {_w} to "&e%{_t}'s world%" #If error, please remove the "'s"
            else:
                set {_a} to "&c&lOFFLINE"
                set {_w} to "&cUnknow"
            set slot {_s} of player's current inventory to {_T}'s skull named "%{_a}%" with lore "&e%{_t}%||&6World: %{_w}%"
            add 1 to {_s}
         
on inventory click:
    if inventory name of player's current inventory is "&6Friend GUI":
        cancel event
 
code_language.skript:
command /friend:
    trigger:
        open chest with 6 rows named "&6Friend GUI" to player
        set {_s} to 0
        loop {friends.%player%::*}:
            set {_T} to loop-value parsed as offline player
            if {_T} is online:
                set {_a} to "&a&lONLINE"
                set {_w} to "&e%{_t}'s world%" #If error, please remove the "'s"
            else:
                set {_a} to "&c&lOFFLINE"
                set {_w} to "&cUnknow"
            set slot {_s} of player's current inventory to {_T}'s skull named "%{_a}%" with lore "&e%{_t}%||&6World: %{_w}%"
            add 1 to {_s}
          
on inventory click:
    if name of player's current inventory is "&6Friend GUI":
        cancel event

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
 
Ok I will test tommorow as I'm going to bed.
[doublepost=1490468543,1490321137][/doublepost]Ok bit late, but it is working like I want it! thanks (marked as solved)