Donator

  • community
  • community-management
  • by meeBob
  • Takaro main
  • all
Version
View export JSON

MeeBob_Donator: Premium VIP Kit System

The MeeBob_Donator module enhances your gaming server with a comprehensive VIP rewards system, designed to recognize and reward your most valuable players. This powerful Takaro module creates an exclusive experience by distributing customizable item packages to players with VIP status.

Key Benefits:

  • Seamless VIP Recognition: Automatically identifies players with VIP permissions
  • Configurable Item Bundles: Customize exactly what items, qualities, and quantities VIP players receive
  • Anti-Abuse Protection: One-time redemption system prevents multiple claims
  • Personalized Welcome Messages: Greet players with custom messages when they connect
  • Easy Administration: Simple configuration through JSON schema

Features:

  • Permission-based access control
  • One-time redemption functionality per server
  • Customizable welcome messages
  • Automated item delivery system
  • Quality and quantity settings for each item

Perfect for server owners looking to monetize through donations while providing tangible in-game benefits to supporters.

Configuration 1

Settings you fill in when installing the module on a server.

SettingTypeDefaultDescription
vipkit Items array VIP Items
Raw config schema
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "required": [],
  "additionalProperties": false,
  "properties": {
    "vipkit": {
      "title": "Items",
      "description": "VIP Items",
      "x-component": "item",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "object",
        "title": "Item",
        "properties": {
          "item": {
            "type": "string",
            "title": "Item"
          },
          "amount": {
            "type": "number",
            "title": "Amount"
          },
          "quality": {
            "type": "string",
            "title": "Quality"
          }
        }
      }
    }
  }
}
Raw UI schema
{}

Commands 1

Chat commands players trigger in game.

  • vipkit

    VIP Items

    Command source
    import { takaro, data, TakaroUserError, checkPermission } from '@takaro/helpers';
    
    const VARIABLE_KEY = 't_vipkit_lock';
    
    async function main() {
        const { pog, gameServerId } = data;
    
        // Check if player has the VIP_KIT_PERMISSION
        if (!checkPermission(pog, 'VIP_KIT_PERMISSION')) {
            throw new TakaroUserError('You do not have permission to use the VIP kit. This command requires VIP status.');
        }
    
        const items = data.module.userConfig.vipkit;
        if (!items || items.length === 0) {
            throw new TakaroUserError('No VIP kit items configured. Please ask your server administrator to configure this.');
        }
    
        const vipKitLockRes = await takaro.variable.variableControllerSearch({
            filters: {
                key: [VARIABLE_KEY],
                gameServerId: [gameServerId],
                playerId: [data.player.id],
            },
        });
    
        if (vipKitLockRes.data.data.length > 0) {
            throw new TakaroUserError('You already used VIP kit on this server');
        }
    
        await data.player.pm('You are about to receive your VIP kit...');
    
        const itemRecords = (await takaro.item.itemControllerSearch({ filters: { id: items.map((_) => _.item) } })).data.data;
        const fullItems = items.map((item) => {
            const itemRecord = itemRecords.find((record) => record.id === item.item);
            if (!itemRecord) {
                throw new TakaroUserError(`Item with ID ${item.item} not found.`);
            }
            return {
                code: itemRecord.code,
                quality: item.quality,
                amount: item.amount,
            };
        });
    
        await Promise.all(fullItems.map(async (item) => {
            return takaro.gameserver.gameServerControllerGiveItem(gameServerId, data.player.id, {
                name: item.code,
                quality: item.quality ?? '',
                amount: item.amount,
            });
        }));
    
        await takaro.variable.variableControllerCreate({
            key: VARIABLE_KEY,
            value: '1',
            gameServerId: gameServerId,
            playerId: data.player.id,
        });
    
        await data.player.pm(`Gave ${items.length} VIP items, enjoy!`);
    }
    
    await main();

Hooks 1

Code that runs in reaction to a game or Takaro event.

  • PlayerConnected

    Hook for player-connected events

    Hook source
    import { takaro, data } from '@takaro/helpers';
    async function main() {
        const { player } = data;
        const rawMessage = data.module.userConfig.message;
        const message = rawMessage.replace('{player}', player.name);
        await takaro.gameserver.gameServerControllerSendMessage(data.gameServerId, {
            message,
        });
    
    }
    await main();
    //# sourceMappingURL=playerConnected.js.map

Permissions 1

Roles you can grant to decide who may use what.

  • VIP Kit

    Vip Items