DocsSeasonalChristmas Gifts

Christmas Gifts

A standalone festive script allowing players to wrap items into gifts and exchange them. Includes a custom NPC Santa, wrapping costs, blacklist system, and Discord logs.

1

Installation

This script is plug-and-play but requires you to add the gift item to your inventory.

Item Setup

Add this item to ox_inventory/data/items.lua or qb-core/shared/items.lua.

items.lua
['wrapped_gift'] = { 
    label = 'Wrapped Gift', 
    weight = 500, 
    stack = false, 
    close = true,
    description = "A mysterious present wrapped with care."
},
Important: Ensure the item name matches Config.Economy.ItemName in the config.
2

Configuration

Below is a complete breakdown of config.lua.

Core Framework

Config.Debug = false
Config.Framework = 'qb'      -- 'qb' or 'esx'
Config.Notify = 'xada_lib'   -- 'ox_lib', 'qb', 'esx', 'xada_lib'
Config.TextUI = 'xada_lib'   -- 'ox_lib', 'xada_lib'
Config.Language = 'en'       -- 'en' or 'lt'

Economy & Blacklist

Config.Economy = {
    Price = 100,             -- Cost to wrap a gift
    Account = 'money',       -- 'money' (cash) or 'bank'
    ItemName = 'wrapped_gift', -- The item given to player
    RemoveOriginal = true,   -- Should the original item be removed?
}

Config.Restrictions = {
    Blacklist = {
        'weapon_rpg',
        'weapon_minigun',
        'markedbills',
        'id_card'
    },
    MaxMessageLength = 100,  -- Character limit for gift messages
}

Use the Blacklist to prevent players from wrapping illegal or game-breaking items inside gifts.

Interaction Method

Choose between using a simple E-key prompt (TextUI) or the Third Eye (Target).

Config.Interaction = {
    Type = 'textui', -- 'textui' OR 'target'
    
    -- Only used if Type is 'target'
    TargetSystem = 'ox_target', -- 'ox_target' OR 'qb-target'

    TextUI = {
        Label = 'Open Workshop',
        Title = 'Santa', 
        KeyLabel = 'E',
        KeyCode = 38, 
        Distance = 2.5,
    },

    Target = {
        Label = 'Open Workshop',
        Icon = 'fa-solid fa-gift',
        Distance = 2.5,
    }
}

Santa NPC

Config.NPC = {
    Enable = true,
    Model = 'mp_f_freemode_01', -- Use 's_m_m_santa' for generic Santa
    Coords = vec4(195.14, -933.91, 29.70, 145.0), -- Location
    Scenario = 'WORLD_HUMAN_CLIPBOARD',
    
    -- Custom Clothing (Freemode Peds Only)
    HeadBlend = { ... },
    Clothes = {
        components = {
            { component_id = 11, drawable = 199, texture = 5 }, -- Jacket
            -- Add more components here
        },
        props = {
            { prop_id = 0, drawable = 24, texture = 0 }, -- Hat
        }
    }
}

The config includes a fully styled custom female Elf/Santa character by default using mp_f_freemode_01. You can change the model to anything you like.

Map Blip

Config.Blip = {
    Enable = true,
    Sprite = 652, -- Gift Icon
    Color = 1,    -- Red
    Scale = 0.8,
    Label = "Santa's Workshop",
    Display = 4,
}

Logging

Config.Discord = {
    Enable = true,
    Webhook = "https://discord.com/api/webhooks/...", 
    BotName = "Xada Gifts",
    
    Colors = {
        Wrapped = 3066993,  -- Green Embed
        Opened = 15158332,  -- Red Embed
    }
}
Logs will track: Who wrapped it, What item was inside, and Who opened it.