API Functions
Listed here are all API functions, along with instructions on how to use them.
Example code currently not implemented.
Service
require(API.Functions.Service):ForceCheckIn(Target, Type, overrideGamepass, Num)Tries checking Target into a room. Ignores game pass requirements of the room type.
Arguments:
Player Target
String, Room Type Type
Bool, optional overrideGamepasswhen set to true, game pass requirements of the room type are ignored.
Room Number, optional Num
Returns:
Table of format {true, Instance Room} or {false, string errorCode}
Room is a folder containing all information about the given room. See Database section for more information.
alreadyCheckedIn
Given when the Player Target is already checked in.
noRoomAvailable
Given when no room is available.
noGamepass
Given when the required game pass is not owned by Player Target.
insufficientArgs
Given when the function is called with insufficient arguments.
require(API.Functions.Service):ForceCheckOut(Target)
Tries checking out Player Target
Arguments:
Player Target
Returns:
Bool Success
API.Functions.Service.CheckedIn.EventBindableEvent fired when a player is checked in
Arguments:
Player Target that was checked in
Player or String Employee
Room Room
When the player is checked out by the server (for example using ForceCheckOut or on leave), Employee is set to the string 'Server' When a player checks out using the self check out, Employee is set to the string 'Self'
API.Functions.Service.CheckedIn.Event:Connect(function(Target, Employee, Room)
if typeof(Employee) == "Player" then
print(Target.Name + " was checked in by " + Employee.Name)
print("They now have room " + Room.Number.Value)
end
end)API.Functions.Service.CheckedOut.EventBindableEvent fired when a player is checked out
Arguments:
Player Target that was checked out
Player or String Employee
Room Room that the player was checked into
When the player is checked out by the server (for example using ForceCheckOut or on leave), Employee is set to the string 'Server' When a player checks out using the self check out, Employee is set to the string 'Self'
API.Functions.Service.CheckedOut.Event:Connect(function(Target, Employee, Room)
if typeof(Employee) == "Player" then
print(Target.Name + " was checked out by " + Employee.Name)
end
end)Doors
require(API.Services.Doors):OpenPlyr(Player, Door)
Sends a request to open a door on behalf of Player Player. It will close after the Timer for the specified door has elapsed.
Arguments:
Player Player
Instance Door model found in CheckMeIn.Doors.Rooms or CheckMeIn.Doors.Custom
Note that the door will only open if Player has permission to open it.
require(API.Services.Doors):Open(Door)
Opens the specified door. It will close after the Timer for the specified door has elapsed.
Arguments:
Instance Door model found in CheckMeIn.Doors.Rooms or CheckMeIn.Doors.Custom
require(API.Services.Doors):ToggleDnD(Room, newValue)
Sets the Do not Disturb value for room Room to newValue.
Arguments:
Instance Room
Bool newValue
require(API.Services.Doors):TogglePM(Room, newValue)
Sets the Private Mode value for room Room to newValue.
Arguments:
Instance Room
Bool newValue
Room Database
Databaserequire(API.Services.Database):GetPlayerRoom(Player)
Finds the room of Player Player.
Arguments:
Player Player
Returns:
Instance Room or false if Player is not checked in
Room is a folder containing all information about the given room. See Database section for more information.
require(API.Services.Database):IsRoommate(Player, Room)
Checks whether Player Player is a roommate of Instance Room.
Arguments:
Player Player
Instance Room
Room is a folder containing all information about the given room. See Database section for more information.
Returns:
Bool isRoommate
require(API.Services.Database):GetAvailableRooms()
Gets a list of available rooms
Returns:
Table containing a Room instance for every available room
Room is a folder containing all information about the given room. See Database section for more information.
require(API.Services.Database):GetDatabaseEntry(roomDoor)
Finds the database entry (Room) from a room door model
Arguments:
Instance roomDoor this has to be a room door model, located in the Rooms folder.
Returns:
Instance Room or false if the specified room door is not valid.
Room is a folder containing all information about the given room. See Database section for more information.
Points System
require(API.Services.Points):AwardPoints(Player, dontRunFunction)
Awards Reward points to Player Player. Reward can be found in the Enterprise options ModuleScript. If dontRunFunction is true, the Function in the Enterprise options ModuleScript will not be fired afterwards.
Arguments:
Player Player
Bool dontRunFunction optional
require(API.Services.Points):GetPoints(Player)Gets the current point value of Player Player.
require(API.Services.Points):SetPoints(Player, Amount, dontRunFunction)
Sets Player Player's points value to Amount. If dontRunFunction is true, the Function in the Enterprise options ModuleScript will not be fired afterwards.
Arguments:
Player Player
Bool dontRunFunction optional
Tutorial State
require(API.Services.Points):SetTutorialState(Player, newValue)
Sets the tutorial state of Player Player to newValue.
Arguments:
Player Player
Bool newValue
require(API.Services.Points):GetTutorialState(Player)
Returns the tutorial state of Player Player.
Arguments:
Player Player
Returns:
Bool completedTutorial
GroupService Cache
CheckMeIn 4.0 uses http requests to get up-to-date player ranks. These results are then cached by the system to limit the amount of http requests used.
require(API.Services.Cache):ClearCache()
Removes cached calls that returned false, meaning players who were not authorized will be checked again after this function runs.
require(API.Services.Cache):DeleteCache()
Removes all cached calls, meaning that all players will be checked again, even if they were authorized before.
require(API.Services.Cache):IsReceptionist(Player)
Checks whether Player Player has receptionist permissions, as set in your Options ModuleScript.
Arguments:
Player Player
Returns:
Bool isReceptionist
require(API.Services.Cache):IsStaff(Player)
Checks whether Player Player has staff permissions, as set in your Options ModuleScript.
Arguments:
Player Player
Returns:
Bool isStaff
require(API.Services.Cache):IsAuthorized(Player, customPermissions)
Checks whether Player Player is authorized based on the supplied customPermissions. This function can be used to get up-to-date ranks from players. The result will automatically be cached by CheckMeIn.
Arguments:
Player Player
DictionarycustomPermissions see custom permissions tab
Returns:
Bool isAuthorized
--Custom Permissions syntax
customPermissions = {}
customPermissions.UserIds = {} -- You can enter a list of authorized user ids here.
customPermissions.Group = 1234 -- Group ID
customPermissions.Minimum = 1 -- Minimum rank that gets authorized
customPermissions.RankTable = {1, 2, ..., 255} -- Table of ranks that are authorized
--Please note that you can only use RankTable OR Minimum, not both.Last updated