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.

Guild System, issues

Discussion in 'Skript' started by AlexWarrior, May 23, 2022.

Tags:
  1. AlexWarrior

    AlexWarrior Member

    Joined:
    Dec 5, 2020
    Messages:
    14
    Likes Received:
    0
    Hello! So I am currently working on a guild system. Basically, users can create a guild and invite their friends. I having some issues however.

    I have a couple variables:
    {guilds::WhatGuild::*} - Explains what guild a user is in
    {guilds::InGuild::*} - Boolean on whether a play is in a guild

    Code (Text):
    1. command /guild [<text>] [<player>]:
    2.     trigger:
    3.         if arg-1 is "invite":
    4.             if arg-2 is set:
    5.                 if player's uuid = {guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Leader}:
    6.  
    7.                     add arg-2 to {guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::InviteList::*}
    8.                     send "&bYou have invited &3%arg-2% &bto the guild!"
    9.                     send "&0" to arg-2
    10.                     send "&bYou were invited to the Guild &6%{guilds::WhatGuild::%player's uuid%}%&b! Type &7/accept %{guilds::WhatGuild::%player's uuid%}%" to arg-2
    11.                     send "&0" to arg-2
    12.                 else:
    13.                     send "&cYou are not the leader of this guild"
    14.            
    15.         else if arg-1 is "kick":
    16.             if arg-2 is set:
    17.                 if player's uuid = {guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Leader}:
    18.                     remove arg-2's uuid from {guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Members::*}
    19.                     delete {guilds::WhatGuild::%arg-2's uuid%}
    20.                     delete {guilds::InGuild::%arg-2's uuid%}
    21.                     send "&bYou have kicked &3%arg-2% &bfrom your guild!"
    22.  
    23.                 else:
    24.                     send "&cYou are not the leader of this guild"
    25.        
    26.         else if arg-1 is "create":
    27.             if {guilds::WhatGuild::%player's uuid%} is not set:
    28.                 set {guilds::CreatingGuildName::%player's uuid%} to true
    29.                 send "&bType in chat the name you want your guild to be! Type cancel to stop"
    30.  
    31.             else:
    32.                 send "&cYou are already in a guild!"
    33.        
    34.         else if arg-1 is "disband":
    35.             broadcast "%{guilds::WhatGuild::%player's uuid%}%"
    36.             broadcast "%{guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Leader} parsed as player%"
    37.             if player's uuid = {guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Leader}:
    38.                 send "&cDisbanding, please wait."
    39.                 wait 1 second
    40.                 loop {guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Members::*}:
    41.                     wait 1 tick
    42.                     send "%{guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Members::%loop-value%}%"
    43.                     send "%{guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%}%"
    44.                     delete {guilds::WhatGuild::%loop-value%}
    45.                     delete {guilds::InGuild::%loop-value%}
    46.                 broadcast "%{guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%}%"
    47.                 delete {guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%}
    48.                 send "&cGuild disbanded"
    49.             else:
    50.                 send "&cYou are not the leader of this guild, if you are trying to leave do /guild leave"
    51.        
    52.         else if arg-1 is "list":
    53.             send "debug %{guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%}%"
    54.             send "Leader: %{guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Leader}%"
    55.             loop {guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Members::*}:
    56.                 set {_player} to loop-value parsed as player
    57.                 send "%{_player}%"
    58.            
    59.         else:
    60.             send "&0&m------------------------------------"
    61.             send "&b&lGuild Commands:"
    62.             send "&7- &f/guild create &7Start the guild creation process"
    63.             send "&7- &f/guild invite <player> &7Invite a player to your guild"
    64.             send "&7- &f/guild kick <player> &7Kick a player from your guild"
    65.             send "&7- &f/guild list &7Show the members of your guild"
    66.             send "&7- &f/guild disband &7Disband your guild"
    67.             send "&7- &f/guild leave &7Leave your current guild"
    68.             send "&7- &f/accept <guild name> &7Accept a Guild Invite"
    69.             send "&0&m------------------------------------"
    70.  
    71. on chat:
    72.     if {guilds::CreatingGuildName::%player's uuid%} is true:
    73.         cancel event
    74.         set {guilds::CreatingGuildName::%player's uuid%} to false
    75.  
    76.         set {_message} to message
    77.  
    78.         if message contains "cancel":
    79.             send "&cCanceled the guild creation process" to player
    80.             stop
    81.            
    82.         if length of {_message} < 3:
    83.             send "&cThe name must me equal to or more than 3 characters" to player
    84.             stop
    85.         if length of {_message} > 10:
    86.             send "&cThe name must me equal to or less than 10 characters" to player
    87.             stop
    88.        
    89.         if {guilds::Guilds::*} contains {_message}:
    90.             send "&cThat guild name is already taken" to player
    91.             stop
    92.        
    93.         add "%{_message}%" to {guilds::Guilds::*}
    94.         add player's uuid to {guilds::InGuild::*}
    95.         set {guilds::Guilds::%{_message}%::Leader} to player's uuid
    96.         set {guilds::WhatGuild::%player's uuid%} to {_message}
    97.  
    98.         send "&bYou have created the Guild &3%{_message}%!" to player
    99.  
    100. command /accept [<text>]:
    101.     trigger:
    102.         if arg-1 is set:
    103.             if {guilds::Guilds::%arg-1%::InviteList::*} contains player:
    104.                 remove player from {guilds::Guilds::%arg-1%::InviteList::*}
    105.                 add player's uuid to {guilds::Guilds::%arg-1%::Members::*}
    106.                 add player's uuid to {guilds::InGuild::*}
    107.                 set {guilds::WhatGuild::%player's uuid%} to arg-1
    108.  
    109.                 send "&bYou have joined &6%arg-1%"
    110.  
    111.             else:
    112.                 send "&cYou dont have a active invite to this guild!"
    113.  
    114. # Debug
    115.  
    116. command /deleteguilds:
    117.     permission: op
    118.     trigger:
    119.         clear {guilds::*}
    120.         send "Deleted"
    The /deleteguilds command is to redo testing.

    Basically my issue is:
    Players create a guild and invite their friend, however, when they disband the guild and do /guild list, it shows that all users are still in a guild and none of the delete syntaxes worked.

    Skript Ver: 2.6.1
    Server: 1.8.8 (I dont want any bs about this version)

    Note: Some broadcasts are just for debugging

    Please let me know if you need anymore information.
    --- Double Post Merged, May 25, 2022, Original Post Date: May 23, 2022 ---
    Still having issues
    --- Double Post Merged, May 26, 2022 ---
    Still having issues
     
  2. JakeTheChad

    Supporter

    Joined:
    Jan 30, 2022
    Messages:
    60
    Likes Received:
    2
    No matter how much you dislike people telling you that the problem may be your version, skript 2.6.1 isn't really meant to be used on 1.8, there are versions for 1.8, using 1.8 for pvp is probably the stupidest thing ever since you can turn 1.9 pvp into 1.8 pvp easily which is why i hope you have a better excuse.
    I won't help in this thread until a further reply about this.
     
  3. AlexWarrior

    AlexWarrior Member

    Joined:
    Dec 5, 2020
    Messages:
    14
    Likes Received:
    0
    You literally had no reason to say this. I'm done with skript as I believe I have enough knowledge with java now and most of the time I ask for help related to skript I get this crap.

    Posting on a thread for a complete bs reason is ridiculous. If you don't want to help don't say anything.

    1.8 is the superior version for pvp. You cant turn 1.9 pvp into 1.8 easily so I don't know what your talking about.

    Edit: 2.6.1 is the version it gives you on the discord when you ask for a 1.8 version of skript
     
  4. JakeTheChad

    Supporter

    Joined:
    Jan 30, 2022
    Messages:
    60
    Likes Received:
    2
    turning 1.9 pvp into 1.8 is ez, its you who cant do it.
     
  5. AlexWarrior

    AlexWarrior Member

    Joined:
    Dec 5, 2020
    Messages:
    14
    Likes Received:
    0
    Do it then
     
  6. JakeTheChad

    Supporter

    Joined:
    Jan 30, 2022
    Messages:
    60
    Likes Received:
    2
    would that make you switch to 1.17/18?
     

Share This Page

Loading...