Server Recieve API

How to fetch the API

local API = LocationToElevatorModel.Cortex_API

How to check for a protocol event

API.Event:Connect(function(protocol, params)
    -- If checks go in here
end)

On Elevator Call

if protocol == 'onElevatorCall' then
    -- Code here
end

Returns

ParameterValue
params.floordestination

On Call Enter

if protocol == 'onCallEnter' then
    -- Code here
end

Returns

ParameterValue
paramsfloor

On Call Remove

if protocol == 'onCallRemove' then
    -- Code here
end

Returns

ParameterValue
paramsfloor

On Door Open

if protocol == 'onDoorOpen' then
    -- Code here
end

Returns

ParameterValue
params.sidesideIndex

On Door Reopen

if protocol == 'onDoorReopen' then
    -- Code here
end

Returns

ParameterValue
params.sidesideIndex

On Door Close

if protocol == 'onDoorClose' then
    -- Code here
end

Returns

ParameterValue
params.sidesideIndex

On Depart Start

if protocol == 'onDepartStart' then
    -- Code here
end

Returns

ParameterValue
params.directionStringU / D
params.directionValue1 / -1

On Depart Pre Start Cancel

if protocol == 'onDepartPreStartCancel' then
    -- Code here
end

On Elevator Move Begin

if protocol == 'onElevatorMoveBegin' then
    -- Code here
end

Returns

ParameterValue
params.directionStringU / D
params.directionValue1 / -1

On Elevator Stop

if protocol == 'onElevatorStop' then
    -- Code here
end

Returns

ParameterValue
params.floorarriveFloor

On Elevator Arrive

if protocol == 'onElevatorArrive' then
    -- Code here
end

Returns

ParameterValue
params.floorfloor
params.directionqueueDirection U / N / D
params.parkingboolean

On Leveling State Change

if protocol == 'onLevelingStageChange' then
    -- Code here
end

Returns

ParameterValue
params.brakingModebrakingMode
params.stagelevelingStage

On Relevel Start

if protocol == 'onRelevelStart' then
    -- Code here
end

Returns

ParameterValue
params.directiondirection

On Safety Brake

if protocol == 'onSafetyBrake' then
    -- Code here
end

On Elevator Lantern API

if protocol == 'onElevatorLanternApi' then
    -- Code here
end

Returns

ParameterValue
params.stateactive / neutral
params.floorfloor
params.directionqueueDirection
params.typeinterior / exterior
params.eventDatalanternEventData
params.conditionMetboolean

Code Example

API.Event:Connect(function(protocol, params)
    if protocol == 'onElevatorLanternApi' then
        if params.floor ~= indicatorFloor then return end
        if params.type ~= 'exterior' then return end -- Exterior lantern
		if params.state == 'active' then
			if params.conditionMet then
				setArrowDirection(params.direction)
			end
		elseif params.state == 'neutral' then
			setArrowDirection('N')
		end
    end
end)
Last Updated: