Gridbase
Paid releasesDime SkillsGuides

Global XP Multipliers

Complete guide to using global XP multipliers for server-wide events

Global XP Multipliers

Run server-wide XP events with global multipliers, perfect for double XP weekends, holidays, and special promotions.

New in v1.9.0: Global multipliers allow you to boost XP gains for all players simultaneously.

Overview

Global XP multipliers affect ALL skill XP gains for ALL players on your server. They're ideal for:

  • 🎉 Weekend events (Double XP Fridays-Sundays)
  • 🎄 Holiday celebrations (Triple XP Christmas)
  • 🚀 Server launches and milestones
  • ⏰ Happy hour events (2x XP 8-10 PM)
  • 🎁 Community rewards

How It Works

When a global multiplier is active:

final_xp = base_xp * custom_multiplier * global_multiplier

Example:

  • Base XP: 100
  • Custom multiplier: 1.5 (VIP bonus)
  • Global multiplier: 2.0 (Double XP weekend)
  • Final XP: 100 × 1.5 × 2.0 = 300 XP

Global multipliers stack with existing bonus multipliers (like VIP bonuses).


Quick Start

Enable in Config

shared/config.lua
GlobalMultipliers = {
    enabled = true,
}

Set a Multiplier

server/events.lua
-- Double XP for 2 hours
exports.dime_skills:setGlobalMultiplier(2.0, 7200)

-- Triple XP for 1 hour
exports.dime_skills:setGlobalMultiplier(3.0, 3600)

-- Permanent 1.5x XP
exports.dime_skills:setGlobalMultiplier(1.5, 0)
/setglobalxp 2.0 7200        # Double XP for 2 hours
/setglobalxp 3.0 3600        # Triple XP for 1 hour
/setglobalxp 1.5 0           # Permanent 1.5x XP
/resetglobalxp               # Reset to 1.0x (normal)
/checkglobalxp               # Check current multiplier

Use Cases & Examples

Weekend Event (Automatic)

Run double XP every weekend automatically:

server/weekend_event.lua
CreateThread(function()
    while true do
        local day = os.date('*t').wday
        local hour = tonumber(os.date('%H'))
        
        -- Friday 6 PM - Start double XP
        if day == 6 and hour == 18 then
            exports.dime_skills:setGlobalMultiplier(2.0, 172800) -- 48 hours
            
            TriggerClientEvent('chat:addMessage', -1, {
                color = {255, 215, 0},
                multiline = true,
                args = {'Weekend Event', '🎉 Double XP Weekend has started!'}
            })
        end
        
        -- Monday 6 AM - End double XP (automatic)
        if day == 1 and hour == 6 then
            exports.dime_skills:resetGlobalMultiplier()
            
            TriggerClientEvent('chat:addMessage', -1, {
                color = {128, 128, 128},
                multiline = true,
                args = {'Weekend Event', '👋 Double XP Weekend has ended. See you next week!'}
            })
        end
        
        Wait(3600000) -- Check every hour
    end
end)

Happy Hour

Run triple XP during specific hours:

server/happy_hour.lua
CreateThread(function()
    while true do
        local hour = tonumber(os.date('%H'))
        
        -- 8 PM - Start happy hour
        if hour == 20 then
            exports.dime_skills:setGlobalMultiplier(3.0, 7200) -- 2 hours
            
            TriggerClientEvent('chat:addMessage', -1, {
                color = {255, 105, 180},
                multiline = true,
                args = {'Happy Hour', '⚡ Triple XP for the next 2 hours!'}
            })
        end
        
        Wait(3600000) -- Check every hour
    end
end)

Server Milestone

Reward players when your server hits a milestone:

server/milestones.lua
RegisterCommand('celebrate', function(source, args)
    if source ~= 0 then return end -- Console only
    
    local milestone = args[1] or '100 players'
    
    -- 24 hour double XP
    exports.dime_skills:setGlobalMultiplier(2.0, 86400)
    
    TriggerClientEvent('chat:addMessage', -1, {
        color = {0, 255, 127},
        multiline = true,
        args = {
            'Server Milestone', 
            string.format('🎊 We hit %s! Enjoy 24 hours of Double XP!', milestone)
        }
    })
end, true)

Holiday Event

Special events for holidays:

server/holidays.lua
local holidays = {
    ['12-25'] = { name = 'Christmas', multiplier = 3.0, duration = 86400 },
    ['12-31'] = { name = 'New Year', multiplier = 2.5, duration = 43200 },
    ['07-04'] = { name = 'Independence Day', multiplier = 2.0, duration = 86400 },
}

CreateThread(function()
    while true do
        local date = os.date('%m-%d')
        local hour = tonumber(os.date('%H'))
        
        if holidays[date] and hour == 0 then
            local event = holidays[date]
            exports.dime_skills:setGlobalMultiplier(event.multiplier, event.duration)
            
            TriggerClientEvent('chat:addMessage', -1, {
                color = {255, 20, 147},
                multiline = true,
                args = {
                    'Holiday Event',
                    string.format('🎉 Happy %s! %.1fx XP active!', event.name, event.multiplier)
                }
            })
        end
        
        Wait(3600000)
    end
end)

Admin Command

Give admins control over XP events:

server/admin_commands.lua
RegisterCommand('startxpevent', function(source, args)
    -- Check if player is admin
    local Player = exports.qbx_core:GetPlayer(source)
    if not Player or Player.PlayerData.job.name ~= 'admin' then return end
    
    local multiplier = tonumber(args[1]) or 2.0
    local duration = tonumber(args[2]) or 3600
    
    exports.dime_skills:setGlobalMultiplier(multiplier, duration)
    
    TriggerClientEvent('chat:addMessage', -1, {
        args = {
            'XP Event',
            string.format('%.1fx XP for %d minutes!', multiplier, duration / 60)
        }
    })
end, false)

RegisterCommand('endxpevent', function(source, args)
    -- Check if player is admin
    local Player = exports.qbx_core:GetPlayer(source)
    if not Player or Player.PlayerData.job.name ~= 'admin' then return end
    
    exports.dime_skills:resetGlobalMultiplier()
    
    TriggerClientEvent('chat:addMessage', -1, {
        args = {'XP Event', 'XP multiplier reset to normal'}
    })
end, false)

API Reference

setGlobalMultiplier

Set a global XP multiplier.

exports.dime_skills:setGlobalMultiplier(multiplier, duration)

Parameters:

  • multiplier (number): Multiplier value (e.g., 2.0 for double XP)
  • duration (number, optional): Duration in seconds (0 or nil for permanent)

Examples:

-- Temporary multipliers
exports.dime_skills:setGlobalMultiplier(2.0, 3600)  -- 1 hour
exports.dime_skills:setGlobalMultiplier(1.5, 7200)  -- 2 hours
exports.dime_skills:setGlobalMultiplier(3.0, 86400) -- 24 hours

-- Permanent multiplier
exports.dime_skills:setGlobalMultiplier(1.5, 0)     -- Until reset
exports.dime_skills:setGlobalMultiplier(1.5)        -- Same as above

Multipliers automatically expire after the duration. No manual reset needed!

getGlobalMultiplier

Get the current multiplier value.

local multiplier = exports.dime_skills:getGlobalMultiplier()

Returns: number - Current multiplier (1.0 = normal)

Example:

local current = exports.dime_skills:getGlobalMultiplier()

if current > 1.0 then
    print('Bonus XP active:', current)
else
    print('Normal XP rates')
end

resetGlobalMultiplier

Reset multiplier to 1.0x (normal).

exports.dime_skills:resetGlobalMultiplier()

Example:

-- End event early
exports.dime_skills:resetGlobalMultiplier()
TriggerClientEvent('chat:addMessage', -1, {
    args = {'Event', 'XP event ended'}
})

Admin Commands

All commands require admin permissions:

/setglobalxp

Set global XP multiplier.

/setglobalxp [multiplier] [duration]

Parameters:

  • multiplier: XP multiplier (e.g., 2.0)
  • duration: Duration in seconds (optional)

Examples:

/setglobalxp 2.0 3600        # Double XP for 1 hour
/setglobalxp 3.0 7200        # Triple XP for 2 hours
/setglobalxp 1.5             # Permanent 1.5x XP

/resetglobalxp

Reset multiplier to normal (1.0x).

/resetglobalxp

/checkglobalxp

Check current multiplier.

/checkglobalxp

Best Practices

Timing

Announce in Advance

Let players know when events will happen:

  • Discord announcements
  • In-game notifications
  • Loading screen messages

Choose Peak Hours

Run events when most players are online:

  • Weekend evenings
  • After work hours (6-10 PM)
  • Holiday periods

Not Too Frequent

Events are special when they're rare:

  • Weekly at most
  • Special occasions
  • Server milestones

Multiplier Values

Don't set multipliers too high - it can unbalance progression!

Recommended values:

  • 1.5x - Small bonus (VIP, happy hour)
  • 2.0x - Standard (weekends, events)
  • 2.5x - Special occasions
  • 3.0x - Rare (holidays, major milestones)
  • 4.0x+ - Extreme (use sparingly)

Duration

Common durations:

  • 1 hour (3600s) - Happy hour
  • 2 hours (7200s) - Evening event
  • 12 hours (43200s) - Half day
  • 24 hours (86400s) - Full day
  • 48 hours (172800s) - Weekend
  • Permanent (0) - Until manually reset

Monitoring

Check Active Multiplier

local multiplier = exports.dime_skills:getGlobalMultiplier()
print('Current multiplier:', multiplier .. 'x')

Log Events

-- Log when multipliers are set
local originalSetMultiplier = exports.dime_skills.setGlobalMultiplier

function exports.dime_skills:setGlobalMultiplier(mult, duration)
    print(string.format('[XP Event] Multiplier set to %.1fx for %ds', mult, duration or 0))
    originalSetMultiplier(mult, duration)
end

Player Feedback

Always notify players when events start/end:

-- Start notification
TriggerClientEvent('chat:addMessage', -1, {
    color = {0, 255, 0},
    args = {'XP Event', string.format('%.1fx XP active!', multiplier)}
})

-- End notification (when expires)
TriggerClientEvent('chat:addMessage', -1, {
    color = {255, 0, 0},
    args = {'XP Event', 'XP event has ended'}
})

Troubleshooting

Multiplier Not Working

  1. Check config:
GlobalMultipliers = {
    enabled = true, -- Must be true
}
  1. Verify multiplier is set:
local mult = exports.dime_skills:getGlobalMultiplier()
print(mult) -- Should be > 1.0
  1. Check XP calculations in Debug mode

Multiplier Expired Early

  • Check system time is correct
  • Verify duration parameter
  • Check for conflicting reset calls

Players Not Seeing Bonus

  • Ensure all players are online when set
  • Check skill notifications are enabled
  • Verify XP is actually being granted

Tips & Tricks

Stacking with VIP Bonuses

Global multipliers stack with custom multipliers:

-- VIP players with 1.5x bonus
-- During 2x global event
-- Total: 1.5 × 2.0 = 3.0x XP

Gradual Increases

Build excitement with increasing multipliers:

-- Hour 1: 1.5x
exports.dime_skills:setGlobalMultiplier(1.5, 3600)

-- Hour 2: 2.0x
exports.dime_skills:setGlobalMultiplier(2.0, 3600)

-- Hour 3: 2.5x (finale)
exports.dime_skills:setGlobalMultiplier(2.5, 3600)

Flash Events

Short, powerful boosts:

-- 30-minute triple XP
exports.dime_skills:setGlobalMultiplier(3.0, 1800)

TriggerClientEvent('chat:addMessage', -1, {
    args = {'⚡ FLASH EVENT', 'Triple XP for 30 minutes!'}
})

Examples Repository

Find more examples in our community repository:

  • Weekend automation scripts
  • Holiday event handlers
  • Custom admin panels
  • Discord bot integration
  • Scheduled events


Happy event hosting! 🎉