Ban System

Config

Config.BanSystem = {
    enable = true, -- Set to true if you want to use this Feature

    discordLog = true, -- Set true to enable DiscordLogs // Add Webhook Link in server/functions/bansystem.lua
    botColor = "6205745", -- https://www.mathsisfun.com/hexadecimal-decimal-colors.html
    botName = "MSK Scripts",
    botAvatar = "https://i.imgur.com/PizJGsh.png",

    commands = {
        enable = true,
        groups = {'superadmin', 'admin', 'god'},
        ban = 'banPlayer',
        unban = 'unbanPlayer'
    }
}

MSK.BanPlayer

This will ban a player

Parameters playerId - number - The ServerId of the player who banned someone - Optional targetId - number - The ServerId of the player who gets banned time - string - The Time until the player gets unbanned reason - string - The Reason why the player gets banned

Description For the Parameter time you can set different types.

  • 1M = 1 Minute

  • 1H = 1 Hour

  • 1D = 1 Day

  • 1W = 1 Week

  • P = Permanent

MSK.UnbanPlayer

This will unban a player

Parameters banId - number - The BanId

Description The Parameter banId is the id in msk_bansystem database

MSK.IsPlayerBanned

This will check if the given player is banned

Parameters playerId - number - The ServerId of the player

Returns isBanned - boolean or table - If the player is banned or not isExpired - boolean or nil - If the Ban is expired or not

Description On a future update we implement that you can search for specific identifiers like license, discord, etc.

Commands

/banPlayer

Parameters targetId - number - The ServerId of the player who gets banned time - string - The Time until the player gets unbanned reason - string - The Reason why the player gets banned - Optional, default: 'Unknown reason'

Description For the Parameter time you can set different types:

  • 1M = 1 Minute

  • 1H = 1 Hour

  • 1D = 1 Day

  • 1W = 1 Week

  • P = Permanent

/unbanPlayer

Parameters banId - number - The BanId

Last updated