mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-14 06:41:55 +00:00
working lanterns
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -77,6 +77,7 @@ type Constructor_Return_Props = {
|
|||||||
GovernorFlyballs: Part,
|
GovernorFlyballs: Part,
|
||||||
PieplatePulley: UnionOperation,
|
PieplatePulley: UnionOperation,
|
||||||
MachineRoom: MovingObjects.MachineRoom,
|
MachineRoom: MovingObjects.MachineRoom,
|
||||||
|
HallDisplays: {Instance},
|
||||||
__MovingConnection: RBXScriptConnection?,
|
__MovingConnection: RBXScriptConnection?,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,11 +170,12 @@ end
|
|||||||
|
|
||||||
function Otis1960.constructor(TagsConstructor, ButtonsTags, LanternsTags, LandingDoors)
|
function Otis1960.constructor(TagsConstructor, ButtonsTags, LanternsTags, LandingDoors)
|
||||||
local self = {} :: Constructor_Return_Props
|
local self = {} :: Constructor_Return_Props
|
||||||
self.ElevatorBox_1960 = TagsConstructor:Request("ElevatorMover_1960") :: UnionOperation
|
self.ElevatorBox_1960 = TagsConstructor:Request("ElevatorMover_1960") :: UnionOperation
|
||||||
self.ElevatorDoor1 = TagsConstructor:Request("ElevatorDoor_1960_1") :: BasePart
|
self.ElevatorDoor1 = TagsConstructor:Request("ElevatorDoor_1960_1") :: BasePart
|
||||||
self.ElevatorDoor2 = TagsConstructor:Request("ElevatorDoor_1960_2") :: BasePart
|
self.ElevatorDoor2 = TagsConstructor:Request("ElevatorDoor_1960_2") :: BasePart
|
||||||
self.ElevatorDoorSensor = TagsConstructor:Request("ElevatorDoor_Sensor_1960") :: Folder
|
self.ElevatorDoorSensor = TagsConstructor:Request("ElevatorDoor_Sensor_1960") :: Folder
|
||||||
self.Ropes = TagsConstructor:Request("1960_ElevatorPulleyRope") :: {Instance}
|
self.Ropes = TagsConstructor:Request("1960_ElevatorPulleyRope") :: {Instance}
|
||||||
|
self.HallDisplays = TagsConstructor:Request("Otis1960_LandingFloorDisplay") :: {Instance}
|
||||||
|
|
||||||
--Rotation objects
|
--Rotation objects
|
||||||
self.MachineRoom = {_CFrame = {}} :: MovingObjects.MachineRoom
|
self.MachineRoom = {_CFrame = {}} :: MovingObjects.MachineRoom
|
||||||
@@ -211,7 +213,8 @@ function Otis1960.constructor(TagsConstructor, ButtonsTags, LanternsTags, Landin
|
|||||||
|
|
||||||
--Open the elevator doors on server start
|
--Open the elevator doors on server start
|
||||||
task.spawn(function()
|
task.spawn(function()
|
||||||
self.ElevatorDoors:ToggleElevatorDoors(true, 1)
|
self.LanternsConstructor:Toggle(true, Attributes.CurrentFloor.Value)
|
||||||
|
self.ElevatorDoors:ToggleElevatorDoors(true, Attributes.CurrentFloor.Value)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
print("🔝 Otis1960 initialized and ready")
|
print("🔝 Otis1960 initialized and ready")
|
||||||
@@ -233,24 +236,22 @@ local function FloorLeveled(self: ClassConstructor, RequestedLevel: number)
|
|||||||
self.LanternsConstructor:Reset(Attributes.CurrentFloor.Value)
|
self.LanternsConstructor:Reset(Attributes.CurrentFloor.Value)
|
||||||
end
|
end
|
||||||
|
|
||||||
local FloorPassingLookAhead = Attributes.CurrentFloor.Value+1
|
|
||||||
|
|
||||||
local function FloorPassingUp(self: ClassConstructor, ElevatorPositionY: number, RequestedLevel: number)
|
local function FloorPassingUp(self: ClassConstructor, ElevatorPositionY: number, RequestedLevel: number)
|
||||||
if ElevatorPositionY>=Leveling[FloorPassingLookAhead] then
|
if ElevatorPositionY>=Leveling[Attributes.CurrentFloor.Value+1] then
|
||||||
FloorPassingLookAhead+=1
|
|
||||||
Attributes.CurrentFloor.Value+=1
|
Attributes.CurrentFloor.Value+=1
|
||||||
|
|
||||||
if Attributes.CurrentFloor.Value ~= RequestedLevel then
|
self.LanternsConstructor:Toggle(true, Attributes.CurrentFloor.Value)
|
||||||
self.LanternsConstructor:Toggle(true, Attributes.CurrentFloor.Value)
|
self.LanternsConstructor:Toggle(false, Attributes.CurrentFloor.Value-1)
|
||||||
self.LanternsConstructor:Toggle(false, Attributes.CurrentFloor.Value-1)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function FloorPassingDown(self: ClassConstructor, ElevatorPositionY: number, RequestedLevel: number)
|
local function FloorPassingDown(self: ClassConstructor, ElevatorPositionY: number, RequestedLevel: number)
|
||||||
--Attributes.CurrentFloor.Value -= 1
|
if ElevatorPositionY<=Leveling[Attributes.CurrentFloor.Value-1] then
|
||||||
|
Attributes.CurrentFloor.Value-=1
|
||||||
|
|
||||||
|
self.LanternsConstructor:Toggle(true, Attributes.CurrentFloor.Value)
|
||||||
|
self.LanternsConstructor:Toggle(false, Attributes.CurrentFloor.Value+1)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Otis1960:__MoveFloors(GoalLevelVEC, RequestedLevel, GoingUp)
|
function Otis1960:__MoveFloors(GoalLevelVEC, RequestedLevel, GoingUp)
|
||||||
@@ -271,8 +272,6 @@ function Otis1960:__MoveFloors(GoalLevelVEC, RequestedLevel, GoingUp)
|
|||||||
local DoorsOpeningEvent = false
|
local DoorsOpeningEvent = false
|
||||||
local ElevatorBoxCurrentPos = self.ElevatorBox_1960.Position
|
local ElevatorBoxCurrentPos = self.ElevatorBox_1960.Position
|
||||||
|
|
||||||
FloorPassingLookAhead = Attributes.CurrentFloor.Value
|
|
||||||
|
|
||||||
--Otis1960_ShaftGovernor
|
--Otis1960_ShaftGovernor
|
||||||
self.__MovingConnection = RS.Heartbeat:Connect(function(_dt)
|
self.__MovingConnection = RS.Heartbeat:Connect(function(_dt)
|
||||||
Delta+=1
|
Delta+=1
|
||||||
|
|||||||
Reference in New Issue
Block a user