I had a simple factions plugin working but I wanted to add the ability to /fconfirm delete and /fdelete but it just stopped is there anyone who can help me?
Also I have no idea what "lists" are I just thought that something like {factions::%uuid of player%::factionname} would be one single variable.
[doublepost=1631991041,1631989058][/doublepost]I think it works but gives me 5 error messages
[doublepost=1631991638][/doublepost]I fixed it!
[doublepost=1631991710][/doublepost]
working code
Also I have no idea what "lists" are I just thought that something like {factions::%uuid of player%::factionname} would be one single variable.
Code:
command /fcreate <string>:
description: Creates a faction
executable by: players
trigger:
set {factions::%uuid of player%::factionlocation} to location of player
set {factions::%uuid of player%::factionname} to "%arg-1%"
set {factions::factionname} to "%arg-1%"
set {factions::%uuid of player%::isowner} to 1
set {factions::%uuid of player%::hasfaction} to 1
message "Created the faction <green>%arg-1%<reset> at <grey>%location of player%<reset>"
command /fdelete:
description: Deletes your faction
executable by: players
trigger:
if {factions::%uuid of player%::isowner} is 1:
set {factions::factionname} to {factions::%uuid of player%::factionname}
message "are you sure you want to <red><bold>delete<reset> %{factions::factionname}%?"
message "this action <red><bold>cannot be undone<reset>"
message "type /fconfirm delete <faction name> if you are sure"
else:
message "you are not the owner of this faction"
command /fconfirm <string> <string>:
description: Confirms the deletion of your faction
executable by: players
trigger:
message "%arg-1%", "%arg-2%"
if "%arg-1%" is "delete":
message "delete"
if {factions::%uuid of player%::hasfaction} is 1:
if {factions::%uuid of player%::is owner} is 1:
set {factions::%uuid of player%::hasfaction} to 0
set {factions::%uuid of player%::factionname} to 0
set {factions::%uuid of player%::isowner} to 0
command /fsethome:
description: Sets your faction home
executable by: players
trigger:
if {factions::%uuid of player%::hasfaction} is 1:
if {factions::%uuid of player%::isowner} is 1:
if "%block below player%" is not "air" or "lava":
set {factions::%uuid of player%::faction location} to location of player
message "set <lime>{factions::%uuid of player%::factionlocation}'s<reset> home to <grey>%location of player%<reset>"
command /fhome:
description: Teleports you to your faction home
executable by: players
trigger:
if {factions::%uuid of player%::hadfaction} is 1:
message "Hello world"
[doublepost=1631991638][/doublepost]I fixed it!
[doublepost=1631991710][/doublepost]
Code:
command /fcreate <string>:
description: Creates a faction
executable by: players
trigger:
set {factions::%uuid of player%::factionlocation} to location of player
set {factions::%uuid of player%::factionname} to "%arg-1%"
set {factions::%uuid of player%::isowner} to 1
set {factions::%uuid of player%::hasfaction} to 1
message "Created the faction <green>%arg-1%<reset> at <grey>%location of player%<reset>"
command /fdelete:
description: Deletes your faction
executable by: players
trigger:
if {factions::%uuid of player%::isowner} is 1:
message "are you sure you want to <red><bold>delete<reset> %{factions::%uuid of player%::factionname}%?"
message "this action <red><bold>cannot be undone<reset>"
message "type /fconfirm delete <faction name> if you are sure"
else:
message "you aren't the owner of this faction!"
command /fconfirm <string> <string>:
description: Confirms the deletion of your faction
executable by: players
trigger:
message "1:%arg-1% 2:%arg-2%"
if "%arg-1%" is "delete":
message "delete"
if {factions::%uuid of player%::hasfaction} is 1:
if {factions::%uuid of player%::is owner} is 1:
set {factions::%uuid of player%::hasfaction} to 0
set {factions::%uuid of player%::factionname} to 0
set {factions::%uuid of player%::isowner} to 0
command /fsethome:
description: Sets your faction home
executable by: players
trigger:
if {factions::%uuid of player%::hasfaction} is 1:
if {factions::%uuid of player%::isowner} is 1:
if "%block below player%" is not "air" or "lava":
set {factions::%uuid of player%::faction location} to location of player
message "set <lime>{factions::%uuid of player%::factionlocation}'s<reset> home to <grey>%location of player%<reset>"
command /fhome:
description: Teleports you to your faction home
executable by: players
trigger:
if {factions::%uuid of player%::hasfaction} is 1:
message "Teleporting you to %{factions::factionname}%"
command /finfo:
description: Prevides you with information about your current faction
executable by: players
trigger:
message "name: %{factions::%uuid of player%::factionname}%"