Scheduled access management
QACAM enables you to schedule access for users with Discord roles.
When you allow a Discord role using the AllowRoles()
function you can also specify a time at which users will be allowed to join. You can do this by passing the function a second argument which will have to be the unix time in seconds (Seconds elapsed since 1st January 1970 at 00:00 UTC).
-- Require the module
local QACAM = require(script:WaitForChild("QACentralAccessManager")
-- Allow QA Leads to join starting 27th September 2023 at 14:00 UTC
QACAM.configuration:AllowRoles({
QACAM.configuration.roles.defaults.QA_LEAD
}, 1695823200)
-- Validate players when they join
game:GetService("Players").PlayerAdded:Connect(function(Player)
local AccessResult = QACAM:GetAccessForPlayer(Player)
-- value will be false if the player doesn't have access
if not AccessResult.value then
Player:Kick(AccessResult.message)
end
end)
QACAM will consider scheduled roles in ascending order based on their schedules.
Consider the following scenario:
Two scheduled roles: 14:00 UTC, 16:00 UTC, in this case QACAM will let players join at 14:00 UTC because it is the earliest time.
Roles priority
If the player has unscheduled matching role and a scheduled role, the unscheduled one will prevail over the scheduled one and will let the player join immediately.
Notes
If a player attempts to join before the scheduled time they will get a "You are not allowed to join yet, please try again later." kick message.
Last updated
Was this helpful?