UsertoPlayerRoleSync

by Mad
for 7 Days to Die
Automatically syncs role assignments from users to their linked in-game players. When a Discord user is assigned or removed from a role, this module ensures that the role is also assigned or removed from their connected in-game player profile.
communityTakaro v0.4.9
(3 versions available)

Components Overview

1
config
0
commands
2
hooks
0
Cron Jobs
1
functions
0
permissions

New Module: UsertoPlayerRoleSync

NEW
December 15, 2025
Updated to version latest. Added 2 hooks: onRoleRemoved (role-removed), onRoleAssigned (role-assigned). Added 1 function: syncUserRoleToPlayer.

Configuration

Configure this module using the schemas below. The JSON schema defines the data structure, while the UI schema customizes how the configuration form is displayed.

Configuration Schema

No configuration properties defined. This module uses default settings.

UI Schema

No UI schema defined. Configuration form will use default rendering.

About Configuration Schemas

The Configuration Schema defines the structure and validation rules for module settings. The UI Schema customizes how the configuration form is displayed in the Takaro interface, including field ordering, labels, and input types.

Hooks (2)

These hooks respond to various game events automatically. Each hook executes JavaScript code when its specific event type occurs, allowing modules to react to player actions, system changes, and more.

Player Events

2 hooks

onRoleRemoved

role-removedEvent Type
Description
Syncs role removals from users to their linked players
Function Implementation

onRoleRemoved Hook Function

JAVASCRIPT
Event Details
Event Type:role-removed
Trigger:Automatic
Category:Player Events

onRoleAssigned

role-assignedEvent Type
Description
Syncs role assignments from users to their linked players
Function Implementation

onRoleAssigned Hook Function

JAVASCRIPT
Event Details
Event Type:role-assigned
Trigger:Automatic
Category:Player Events

About Module Hooks

Hooks allow your module to respond automatically to game events like player actions, server status changes, and chat messages. Each hook has an event type that determines when it triggers, optional regex patterns for filtering specific events, and a JavaScript function that executes when the conditions are met. Hooks are grouped by category for better organization.

Functions (1)

Reusable JavaScript functions that can be imported and used by other module components like commands, hooks, and cron jobs. These promote code reuse and modularity.

syncUserRoleToPlayer

functionReusable Component

Description

Syncs role assignments from users to their linked players

Function Implementation

syncUserRoleToPlayer Function

JAVASCRIPT

Import Usage

Import: import { syncUserRoleToPlayer } from './utils';

About Module Functions

Functions are reusable JavaScript components that can be imported and used by commands, hooks, and cron jobs within your module. They promote code reuse, improve maintainability, and allow you to organize complex logic into modular pieces. Functions must be exported with proper ES6/CommonJS syntax to be importable by other components.