CheckMeIn 3.1 API

Introduction

If you have custom code which would otherwise interfere with CheckMeIn, you can connect the two using CheckMeIn's rich API functions.
Warning: Lua knowledge is required to properly use these functions.

You can interact with the CheckMeIn API through Plugins.
You will need to use the premade template to make a plugin:

return{
['Enabled'] = true; -- Is this plugin enabled?
['Function'] = function(API)
-- Your code goes here
end}

Enabled specifies whether the plugin will run or not. You will write your code in the Function value. The function runs at the beginning of the server, and the API can be accessed by using the provided API value, part of the function.

API Functions

Listed here are all API functions, along with instructions on how to use them.

API.Doors.Open:Fire(door)

Description
Opens the CheckMeIn door model specified.
Parameters
door
Type: Door Model
Required
Example
API.Doors.Open:Fire(workspace.CheckMeIn.Doors.Custom.Door)

API.Service.CheckedIn:Event:Connect(function(employee,player,door)

Description
This event fires when a player is checked in.
Parameters
employee
Type: variable (Player, string or nil)
player
Type: Player (the player who was checked in)
door
Type: Model (room door)
Note

  • This event fires when the employee who sent a check in request leaves the game before it is accepted. The employee property will be set to nil
  • This event fires when self check in is used. The employee property will be set to 'SCI' (string)

API.Service.CheckedOut:Event:Connect(function(employee,player,door)

Description
This event fires when a player is checked out.
Parameters
employee
Type: variable (Player, string or nil)
player
Type: Player (the player who was checked in)
door
Type: Model (room door)
Note

  • This event fires when players disconnect. The employee property will be set to 'DISCONNECT' (string)
  • This event fires when the employee who sent a check out request leaves the game before it is accepted. The employee property will be set to nil
  • This event fires when self check out is used. The employee property will be set to 'SCI' (string)

API.Service.ForceCheckIn:Fire(player,roomType)

Description
Checks in the specified player.
Parameters
player
Type: Player
Required
roomType
Type: String (must be a valid room type, case sensitive)
Required

API.Service.ForceCheckOut:Fire(player)

Description
Checks out the specified player.
Parameters
player
Type: Player
Required

API.Web.GetPoints:Invoke(userId)

Description
Gets the amount of points of the Player specified.
Parameters
userId
Type: Integer (Player.UserId)
Required
Returns
Points (number) or 0

API.Web.RewardPoints:Fire(userId,amount)

Description
Rewards the increment amount of points the Player specified.
Increment setting can be found in workspace.CheckMeIn.Configuration.Points
Parameters
userId
Type: Integer (Player.UserId)
Required
amount
Type: Integer
Not required: If amount is not specified, the player will be given Award number of points. This value can be found inside CheckMeIn's configuration folder.
Note
This function only works for players online in the server.

API.Web.SetPoints:Fire(userId,amount)

Description
Sets the Points value of the specified player.

WARNING: SetPoints will overwrite any existing data. Please be careful with this command.

Parameters
userId
Type: Integer (Player.UserId)
Required
amount
Type: Integer
Required
Note
This function only works for players online in the server.

API.Web.GetTutorialState:Invoke(Player)

Description
Gets the Tutorial State of the Player specified. (whether they've done the tutorial or not)
Parameters
Player
Type: Player
Required
Returns
Boolean Tutorial State. true = complete, false = incomplete

API.Web.Webhook:Fire(message)

Description
Sends message to your connected Discord server. Only works with an Enterprise license and when the Webhook is enabled.
Parameters
message
Type: String
Required
Note
The Discord webhook is deprecated and does not respect Discord's rate limits. Use it at your own risk.

Suggestions for new API functions? Contact Tim#6198 on Discord!

footer-frame