i need to figure out how to clear this variable with a seperate command and someone else executing it.

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

    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!

timeous

Member
Jul 25, 2023
3
0
1
Code:
command /rename [<text>]:
    permission: rename.use
    trigger:
        if arg-1 is not set:
            message "&7[§x§f§b§0§0§0§0♦&7] Usage: /rename <text>."
        else:
            if player's tool is not air:
                if {renamecooldown::%player%} is true:
                    message "&7[§x§f§b§0§0§0§0♦&7] This command is on cooldown."
                else:
                    if length of arg-1 is less than 17:
                        if length of arg-1 > 2:
                            if arg-1 is set:
                                set name of player's tool to colored arg-1
                                if {renamecooldown::%player%} is not set:
                                    set {renamecooldown::%player%} to true
                                    wait 600 seconds
                                    clear {renamecooldown::%player%}
                            else:
                                message "&7[§x§f§b§0§0§0§0♦&7] Usage: /rename <text>."
                        else:
                            message "&7[§x§f§b§0§0§0§0♦&7] Your text must be at least 3 characters."
                    else:
                        message "&7[§x§f§b§0§0§0§0♦&7] Your text cannot exceed 16 characters."
            else:
                message "&7[§x§f§b§0§0§0§0♦&7] You must be holding an item."


command /renamecdreset [<text>]:
    trigger:
        if arg-1 is not set:
            message "&7[§x§f§b§0§0§0§0♦&7] Usage: /renamecdreset <player>."
        else:
            if {renamecooldown::arg-1} is true
                clear {renamecooldown::arg-1}
                message "&7[§x§f§b§0§0§0§0♦&7] Succesfully reset cooldown."
            else:
                message "&7[§x§f§b§0§0§0§0♦&7] Command is not on cooldown."


This is my current skript and I'm trying to make it so the /renamecdreset resets the cooldown of the player who is in the command for example /renamecdreset Timeous which would reset my cooldown but with what I have right now it doesn't reset it.
 
Hey, I don't know what you were thinking there, it was enough to put
Code:
{renamecooldown::%player%}
instead of
Code:
{renamecooldown::arg-1}
and thats it. Try it and LMK, btw I made a minor change at the end, if you dont like it, change it back. :emoji_slight_smile:
The final skript:
Code:
command /rename [<text>]:
    permission: rename.use
    trigger:
        if arg-1 is not set:
            message "&7[§x§f§b§0§0§0§0♦&7] Usage: /rename <text>."
        else:
            if player's tool is not air:
                if {renamecooldown::%player%} is true:
                    message "&7[§x§f§b§0§0§0§0♦&7] This command is on cooldown."
                else:
                    if length of arg-1 is less than 17:
                        if length of arg-1 > 2:
                            if arg-1 is set:
                                set name of player's tool to colored arg-1
                                if {renamecooldown::%player%} is not set:
                                    set {renamecooldown::%player%} to true
                                    wait 600 seconds
                                    clear {renamecooldown::%player%}
                            else:
                                message "&7[§x§f§b§0§0§0§0♦&7] Usage: /rename <text>."
                        else:
                            message "&7[§x§f§b§0§0§0§0♦&7] Your text must be at least 3 characters."
                    else:
                        message "&7[§x§f§b§0§0§0§0♦&7] Your text cannot exceed 16 characters."
            else:
                message "&7[§x§f§b§0§0§0§0♦&7] You must be holding an item."


command /renamecdreset [<player>]:
   permission: renamecdreset.use
    trigger:
        if arg-1 is not set:
            message "&7[§x§f§b§0§0§0§0♦&7] Usage: /renamecdreset <player>."
        else:
            if {renamecooldown::%player%} is true:
                clear {renamecooldown::%player%}
                message "&7[§x§f§b§0§0§0§0♦&7] %arg-1%'s cooldown has been successfully reset."
            else:
                message "&7[§x§f§b§0§0§0§0♦&7] Command is not on cooldown."
 
Last edited: