TALQENDocs

Roblox integration

Talqen integrates with your Roblox game over HTTPS from server-side Scripts. You decide when shifts start, heartbeat, and stop.

Requirements

  • Enable HttpService (Allow HTTP Requests)
  • Use server-side Scripts only (ServerScriptService)
  • Store API keys outside replicated containers
  • Generate unique Idempotency-Key values per mutation

Roblox identifiers

Roblox valueTalqen field
game.GameIdUniverse ID (universeId)
game.PlaceIdPlace ID (placeId)
game.JobIdServer ID (serverId)
player.UserIdRoblox user ID (robloxUserId)

Client-owned lifecycle

Your game decides when a shift starts, how often to heartbeat, and when to stop. Talqen validates credentials, universe allowance, staff mapping, and request idempotency.

Example: custom clock-in button

Clock-in (server)lua
-- Starting point: custom clock-in RemoteEvent handled server-side.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Talqen = require(script.Parent.TalqenClient) -- your ModuleScript helper

local clockIn = Instance.new("RemoteEvent")
clockIn.Name = "TalqenClockIn"
clockIn.Parent = ReplicatedStorage

clockIn.OnServerEvent:Connect(function(player)
  -- Enforce your own eligibility rules here (team, rank, etc.).
  local shiftId = Talqen.startShift(player)
  if shiftId then
    -- Store shiftId server-side for heartbeat and disconnect cleanup.
  end
end)

Example: team change tracking

Team change (server)lua
-- Starting point: track Team changes as shift boundaries.
local Teams = game:GetService("Teams")
local Talqen = require(script.Parent.TalqenClient)

local STAFF_TEAM_NAME = "Staff"

local function onTeamChanged(player)
  local isStaff = player.Team and player.Team.Name == STAFF_TEAM_NAME
  local existing = Talqen.activeShifts[player.UserId]

  if isStaff and not existing then
    Talqen.startShift(player)
  elseif (not isStaff) and existing then
    Talqen.stopShift(existing, "manual")
    Talqen.activeShifts[player.UserId] = nil
  end
end

-- Wire Player:GetPropertyChangedSignal("Team") / team assignment in your game.

Example: player disconnect cleanup

Disconnect cleanup (server)lua
-- Starting point: clean up on disconnect and shutdown.
local Players = game:GetService("Players")
local Talqen = require(script.Parent.TalqenClient)

Players.PlayerRemoving:Connect(function(player)
  local shiftId = Talqen.activeShifts[player.UserId]
  if shiftId then
    Talqen.stopShift(shiftId, "player_left")
    Talqen.activeShifts[player.UserId] = nil
  end
end)

game:BindToClose(function()
  for userId, shiftId in pairs(Talqen.activeShifts) do
    Talqen.stopShift(shiftId, "server_shutdown")
    Talqen.activeShifts[userId] = nil
  end
end)