Configuration
You can customize the whole script according to your needs. If you can not adjust something or there are errors, feel free to contact us on our Discord server.
Config file
Config = {}
-- Language Configuration
Config.Language = "en"
Config.AvailableLanguages = {
"en", "de", "fr", "es", "it", "pt", "ru", "pl", "nl", "da", "sv", "no", "fi",
"cs", "hu", "tr", "ar", "zh", "ja", "ko", "th", "vi", "hi", "bn", "ur"
}
-- Scratchcard Symbols
Config.Symbols = {
"🍒", "⭐", "🎁", "🔥", "💎", "🍉", "🌍", "🔎", "💰", "🎯"
}
-- Win Configuration
Config.PossibleAmounts = {100, 250, 500, 1000, 2500, 5000, 10000, 25000}
Config.EnableWeightedAmounts = true
Config.AmountChances = {
{amount = 100, chance = 35}, -- 35% chance
{amount = 250, chance = 25}, -- 25% chance
{amount = 500, chance = 20}, -- 20% chance
{amount = 1000, chance = 10}, -- 10% chance
{amount = 2500, chance = 5}, -- 5% chance
{amount = 5000, chance = 3}, -- 3% chance
{amount = 10000, chance = 1.5}, -- 1.5% chance
{amount = 25000, chance = 0.5} -- 0.5% chance
}
-- Item Configuration
Config.ItemName = "scratchcard"
-- Game Logic
Config.WinCondition = 3 -- Minimum matching symbols to win
Config.GridSize = 9 -- 3x3 grid
-- Framework Configuration (auto-detection)
Config.Framework = "auto" -- "auto", "esx", "qbcore", "qbox"
-- Notification System (auto-detection)
Config.NotificationScript = "auto" -- "auto", "esx", "ox", "qb", "qbox", "custom"
-- Anti-Spam Protection
Config.PreventSpam = true
Config.SpamCooldown = 2000 -- Cooldown in milliseconds
Config.MaxTransactionsPerMinute = 5 -- Max transactions per player per minute
-- UI Settings
Config.AutoCloseDelay = 3000 -- Auto-close delay in milliseconds
-- Discord Webhook (optional)
Config.WebhookURL = "" -- Discord webhook URL for logging
-- Framework Settings (auto-detection)
Config.FrameworkSettings = {
esx = {
resource = "es_extended",
getObject = function()
return exports.es_extended:getSharedObject()
end
},
qbcore = {
resource = "qb-core",
getObject = function()
return exports['qb-core']:GetCoreObject()
end
},
qbox = {
resource = "qbx_core",
getObject = function()
return exports.qbx_core
end
}
}
-- Configuration validation
CreateThread(function()
Wait(1000)
-- Validate win chances
if Config.EnableWeightedAmounts then
local totalChance = 0
for _, config in ipairs(Config.AmountChances) do
totalChance = totalChance + config.chance
end
if math.abs(totalChance - 100) > 0.1 then
print(("^3[Scratchcard Warning]^7 Total win chances: %.2f%% (should be 100%%)"):format(totalChance))
end
end
-- Validate grid size
local gridSqrt = math.sqrt(Config.GridSize)
if gridSqrt ~= math.floor(gridSqrt) then
print(("^1[Scratchcard Error]^7 GridSize must be a perfect square (current: %d)"):format(Config.GridSize))
end
end)
Last updated