Skript Commands with Anti Spam?

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

Adrihun

Member
Feb 1, 2017
368
6
0
I made a Rank Manager in script, so if you do /setrank Adrihun Owner, it will give me the rank Owner and I have also added some nice things to it like fireworks. And if an admin spams this command, there will be a lot of fireworks, etc.

So I tried to make an anti spam for this and it worked. But if a normal player types this in, it will tell them
Rank Manager is on cooldown. Now I don't want this. I only want to show "No Permission".
I tried adding "if player has permission:" and then "else:" to this, but it just keeps giving me errors in console. Please help me if you understand what i'm saying. lol.

Here are some images if you still don't understand what i'm talking about:
R8C0Ay3.png

Basically, I don't want to show the 2nd line if the player doesn't have the permission "rankset.spam"

code_language.skript:
on command "/setrank":
    wait 1 tick
    set {sql_.antispamRank.%player%} to true
    wait 30 seconds
    set {sql_.antispamRank.%player%} to false
 
on command "/setrank":
    if {sql_.antispamRank.%player%} is true:
        cancel event
        message "&6> &eRank Manager&7 is on cooldown, please wait."
[doublepost=1491523957,1491522234][/doublepost]bump
 
code_language.skript:
on command "/setrank":
    set {_waited} to difference between {cmdcountdown.%player%} and now
    if {_waited} is less than 30 seconds:
        cancel event
        set {_time} to difference between 30 seconds and {_waited}
        send "&cCommand is in Countdown, wait %{_time}% seconds!"
    else:
        set {cmdcountdown.%player%} to now
 
code_language.skript:
on command "/setrank":
    set {_waited} to difference between {cmdcountdown.%player%} and now
    if {_waited} is less than 30 seconds:
        cancel event
        set {_time} to difference between 30 seconds and {_waited}
        send "&cCommand is in Countdown, wait %{_time}% seconds!"
    else:
        set {cmdcountdown.%player%} to now
Thanks for improving my script but i don't think you understand what i'm trying to say.
What i want is that if the player doesn't have the permission "command.setrank" it won't tell them "command is in Countdown" it will tell them "no permission"
 
Last edited by a moderator:
code_language.skript:
command setrank:
    Trigger:
        player has permission "lul":
            set {_diff} to difference between now and {sql_.diff::%player%}
            {_diff} is less than 30 seconds:
                send "nononono"
                stop
            set {sql_.diff::%player%} to now
             # Do things
        else:
            send "nonono permission"

Sent from Handy, sry
 
Last edited by a moderator:
  • Like
Reactions: BrettPlayMC
Status
Not open for further replies.