This section lists all available commands, exports, and events included in the script. You’ll find client-side, server-side, and shared functions designed to help developers integrate, extend, or interact with the system easily within their own scripts or frameworks.
Commands
This section lists all available commands included in the script. Each command is designed to simplify administration, player interaction, or debugging tasks. You’ll find detailed descriptions, usage examples, and permission requirements to help you manage and customize your server efficiently.
Command
Description
/shuttercreator
Command to create shutters.
Client Exports
This section provides all available client exports for the script. These functions allow you to interact directly with the system from the client side, enabling custom features, UI interactions, and integrations with other resources. Each export includes a short description and usage example for easy implementation.
getCurrentShutterId
The getCurrentShutterId export allows you to retrieve the closest shutter interaction point to the player. Result: you instantly know which shutter the player is currently targeting so you can perform actions on it with precision.
How to Use
To get the current shutter ID, use the following code:
local shutterId = exports['qs-shutters-creator']:getCurrentShutterId()print("Closest shutter ID: " ..tostring(shutterId))
This will return the ID of the shutter nearest to the player. You can then use this value to apply logic such as opening, closing, locking, triggering animations or checking permissions based on a specific shutter.
getCurrentShutter
The getCurrentShutter export allows you to access the full data of the shutter currently closest to the player. This export proves useful when you need detailed information about the shutter before performing any action on it.
How to Use
To get the shutter data, use the following code:
local shutterData = exports['qs-shutters-creator']:getCurrentShutter()print("Current shutter data: " ..tostring(shutterData))
This will return a table containing all the available information about the nearest shutter (if any). You can use this data to manage interactions, validate permissions, trigger animations or apply custom logic based on the shutter’s configuration.
Server Exports
This section provides all available server exports for the script. These functions allow developers to interact with the system from the server side, manage data, trigger actions, and integrate with other resources. Each export includes a clear description and a practical example to simplify its implementation.
getShutters
The getShutters export allows you to obtain a full list of every shutter currently registered on the server. Ideal for systems that require global access, tracking, validation or synchronization of shutters.
How to Use
To retrieve all shutters, use the following code:
local shutters = exports['qs-shutters-creator']:getShutters()
print("Total shutters: " .. tostring(shutters))
This will return a table containing all shutters. Each entry includes the shutter configuration and properties you can use to loop through, apply actions, run distance checks or build interfaces that display shutter data to players.
setLocked
The setLocked export allows you to lock or unlock a specific shutter by ID. Perfect for controlling access, creating security systems or syncing shutter states across the server.
How to Use
To change the lock state of a shutter, use the following code:
local success = exports['qs-shutters-creator']:setLocked(1, true)
print("Shutter locked? " .. tostring(success))
This export expects:
id: the shutter identifier (number)
locked: whether the shutter should be locked (boolean)
If the operation is valid, it updates the shutter’s state in the database and notifies all clients. The function returns true upon success, or false if the shutter is not found or the parameter type is incorrect.