diff --git a/src/server/main/Elevators/Otis1960/RelayAlgorithm.luau b/src/server/main/Elevators/Otis1960/RelayAlgorithm.luau index e76ac6a..259ee6a 100644 --- a/src/server/main/Elevators/Otis1960/RelayAlgorithm.luau +++ b/src/server/main/Elevators/Otis1960/RelayAlgorithm.luau @@ -18,6 +18,10 @@ type Constructor_Return_Props = { ElevatorAttributes: ElevatorAttributes, DoorAttributes: DoorAttributes, __FloorQueue: FloorQueue, + + Events: { + Sorted: BindableEvent + }, } type ElevatorAttributes = { @@ -51,6 +55,10 @@ function RelayAlgorithm.constructor(BoxAlignPosition, ElevatorAttributes, DoorAt ElevatorAttributes = ElevatorAttributes, DoorAttributes = DoorAttributes, __FloorQueue = {}, + + Events = { + Sorted = Instance.new("BindableEvent") :: BindableEvent + }, }, RelayAlgorithm) end @@ -64,6 +72,7 @@ function RelayAlgorithm:Sort(ElevatorGoingUp) end return a>b end) + self.Events.Sorted:Fire() end function RelayAlgorithm:Check(ElevatorGoingUp) @@ -82,4 +91,4 @@ function RelayAlgorithm:AddFloor(ElevatorGoingUp, RequestedLevel) self:Sort(ElevatorGoingUp) end -return RelayAlgorithm \ No newline at end of file +return RelayAlgorithm