Files
Roblox-Elevator-Game/src/server/Elevators/Floors.lua

36 lines
812 B
Lua

--!optimize 2
--!native
--!strict
local Floors = {}
Floors.__index = Floors
local Storage = game:GetService("ReplicatedStorage")
local CS = game:GetService("CollectionService")
local Tags = require(Storage:WaitForChild("Tags"))
function Floors.constructor(NumberOfFloors: number, Year: string)
local Floors = {}
for i: number = 1, NumberOfFloors do
local FloorTag_1 = CS:GetTagged(`ElevatorDoor_{Year}_Floor{tostring(i)}_1`)
local FloorTag_2 = CS:GetTagged(`ElevatorDoor_{Year}_Floor{tostring(i)}_2`)
if FloorTag_1 then
table.insert(Floors, FloorTag_1)
end
if FloorTag_2 then
table.insert(Floors, FloorTag_2)
end
end
return setmetatable({
NumberOfFloors = NumberOfFloors,
Floors = Floors
}, Floors)
end
function Floors:GetFloor(Floor: number): Instance?
end
return Floors