AntiSpam.sk

Created by Pepsikovec

Just so you know, we don't know the file format for every file. If it's just a bunch of random characters, it's probably a .zip or .jar.

# By _Pepsik_
# Version 1.0

#=====================================================================================#
#                                                                                     #
#          T H A N K S   F O R   D O W N L O A D   T H I S   S K R I P T              # 
#                                                                                     #
#=====================================================================================#

options:
#-----------------------------------------------------------------#
#                                                                 #
#        Here you can change these messages/permissions.          #
#                                                                 #
#-----------------------------------------------------------------#

    prefix: &8[&6AntiSpam&8]

    bypass-permission: antispam.bypass
    no-bypass-message: &cYou can write in &6%{spam.timer.%player%}%&r &cseconds!

            #=============================================#
            # %{spam.timer.%player%}% = time for chatting #
            #=============================================#

    # Here you can set the time for chatting. (Only in seconds!)
    time: 5

#------------------------------------------------------------#
#                                                            #
#   !!! If you don't know this coding, don't change it !!!   #
#                                                            #
#------------------------------------------------------------#

on join:
    set {spam.%player%} to false    

on first join:
    set {spam.%player%} to false   

variables:
    {spam.%player%} = false

on chat:
    if player has permission "{@bypass-permission}":
        stop
    else:
        if {spam.%player%} is false:
            set {spam.%player%} to true
            set {spam.timer.%player%} to {@time}
        else:
            cancel event
            send "{@prefix} {@no-bypass-message}"

every 1 second:
    loop all players:
        if {spam.%loop-player%} is true:
            if {spam.timer.%loop-player%} is not 1:
                remove 1 from {spam.timer.%loop-player%}
            else:
                set {spam.%loop-player%} to false
                clear {spam.timer.%loop-player%}
                
#=====================================================================================#
#                                                                                     #
#                            E N D   OF   T H I S   C O D E                           # 
#                                                                                     #
#=====================================================================================#