Solved Im so confused, It was working

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

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

mrclipse

Member
Sep 18, 2021
11
0
1
5111 98th St, Lubbock, TX 79424
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.

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=1631991041,1631989058][/doublepost]I think it works but gives me 5 error messages
[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}%"
working code
 
Status
Not open for further replies.