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
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.
[doublepost=1653505171,1653336047][/doublepost]Still having issues
[doublepost=1653602733][/doublepost]Still having issues
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:
command /guild [<text>] [<player>]:
trigger:
if arg-1 is "invite":
if arg-2 is set:
if player's uuid = {guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Leader}:
add arg-2 to {guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::InviteList::*}
send "&bYou have invited &3%arg-2% &bto the guild!"
send "&0" to arg-2
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
send "&0" to arg-2
else:
send "&cYou are not the leader of this guild"
else if arg-1 is "kick":
if arg-2 is set:
if player's uuid = {guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Leader}:
remove arg-2's uuid from {guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Members::*}
delete {guilds::WhatGuild::%arg-2's uuid%}
delete {guilds::InGuild::%arg-2's uuid%}
send "&bYou have kicked &3%arg-2% &bfrom your guild!"
else:
send "&cYou are not the leader of this guild"
else if arg-1 is "create":
if {guilds::WhatGuild::%player's uuid%} is not set:
set {guilds::CreatingGuildName::%player's uuid%} to true
send "&bType in chat the name you want your guild to be! Type cancel to stop"
else:
send "&cYou are already in a guild!"
else if arg-1 is "disband":
broadcast "%{guilds::WhatGuild::%player's uuid%}%"
broadcast "%{guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Leader} parsed as player%"
if player's uuid = {guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Leader}:
send "&cDisbanding, please wait."
wait 1 second
loop {guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Members::*}:
wait 1 tick
send "%{guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Members::%loop-value%}%"
send "%{guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%}%"
delete {guilds::WhatGuild::%loop-value%}
delete {guilds::InGuild::%loop-value%}
broadcast "%{guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%}%"
delete {guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%}
send "&cGuild disbanded"
else:
send "&cYou are not the leader of this guild, if you are trying to leave do /guild leave"
else if arg-1 is "list":
send "debug %{guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%}%"
send "Leader: %{guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Leader}%"
loop {guilds::Guilds::%{guilds::WhatGuild::%player's uuid%}%::Members::*}:
set {_player} to loop-value parsed as player
send "%{_player}%"
else:
send "&0&m------------------------------------"
send "&b&lGuild Commands:"
send "&7- &f/guild create &7Start the guild creation process"
send "&7- &f/guild invite <player> &7Invite a player to your guild"
send "&7- &f/guild kick <player> &7Kick a player from your guild"
send "&7- &f/guild list &7Show the members of your guild"
send "&7- &f/guild disband &7Disband your guild"
send "&7- &f/guild leave &7Leave your current guild"
send "&7- &f/accept <guild name> &7Accept a Guild Invite"
send "&0&m------------------------------------"
on chat:
if {guilds::CreatingGuildName::%player's uuid%} is true:
cancel event
set {guilds::CreatingGuildName::%player's uuid%} to false
set {_message} to message
if message contains "cancel":
send "&cCanceled the guild creation process" to player
stop
if length of {_message} < 3:
send "&cThe name must me equal to or more than 3 characters" to player
stop
if length of {_message} > 10:
send "&cThe name must me equal to or less than 10 characters" to player
stop
if {guilds::Guilds::*} contains {_message}:
send "&cThat guild name is already taken" to player
stop
add "%{_message}%" to {guilds::Guilds::*}
add player's uuid to {guilds::InGuild::*}
set {guilds::Guilds::%{_message}%::Leader} to player's uuid
set {guilds::WhatGuild::%player's uuid%} to {_message}
send "&bYou have created the Guild &3%{_message}%!" to player
command /accept [<text>]:
trigger:
if arg-1 is set:
if {guilds::Guilds::%arg-1%::InviteList::*} contains player:
remove player from {guilds::Guilds::%arg-1%::InviteList::*}
add player's uuid to {guilds::Guilds::%arg-1%::Members::*}
add player's uuid to {guilds::InGuild::*}
set {guilds::WhatGuild::%player's uuid%} to arg-1
send "&bYou have joined &6%arg-1%"
else:
send "&cYou dont have a active invite to this guild!"
# Debug
command /deleteguilds:
permission: op
trigger:
clear {guilds::*}
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.
[doublepost=1653505171,1653336047][/doublepost]Still having issues
[doublepost=1653602733][/doublepost]Still having issues