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,
|
||||
PieplatePulley: UnionOperation,
|
||||
MachineRoom: MovingObjects.MachineRoom,
|
||||
HallDisplays: {Instance},
|
||||
__MovingConnection: RBXScriptConnection?,
|
||||
}
|
||||
|
||||
@@ -174,6 +175,7 @@ function Otis1960.constructor(TagsConstructor, ButtonsTags, LanternsTags, Landin
|
||||
self.ElevatorDoor2 = TagsConstructor:Request("ElevatorDoor_1960_2") :: BasePart
|
||||
self.ElevatorDoorSensor = TagsConstructor:Request("ElevatorDoor_Sensor_1960") :: Folder
|
||||
self.Ropes = TagsConstructor:Request("1960_ElevatorPulleyRope") :: {Instance}
|
||||
self.HallDisplays = TagsConstructor:Request("Otis1960_LandingFloorDisplay") :: {Instance}
|
||||
|
||||
--Rotation objects
|
||||
self.MachineRoom = {_CFrame = {}} :: MovingObjects.MachineRoom
|
||||
@@ -211,7 +213,8 @@ function Otis1960.constructor(TagsConstructor, ButtonsTags, LanternsTags, Landin
|
||||
|
||||
--Open the elevator doors on server start
|
||||
task.spawn(function()
|
||||
self.ElevatorDoors:ToggleElevatorDoors(true, 1)
|
||||
self.LanternsConstructor:Toggle(true, Attributes.CurrentFloor.Value)
|
||||
self.ElevatorDoors:ToggleElevatorDoors(true, Attributes.CurrentFloor.Value)
|
||||
end)
|
||||
|
||||
print("🔝 Otis1960 initialized and ready")
|
||||
@@ -233,24 +236,22 @@ local function FloorLeveled(self: ClassConstructor, RequestedLevel: number)
|
||||
self.LanternsConstructor:Reset(Attributes.CurrentFloor.Value)
|
||||
end
|
||||
|
||||
local FloorPassingLookAhead = Attributes.CurrentFloor.Value+1
|
||||
|
||||
local function FloorPassingUp(self: ClassConstructor, ElevatorPositionY: number, RequestedLevel: number)
|
||||
if ElevatorPositionY>=Leveling[FloorPassingLookAhead] then
|
||||
FloorPassingLookAhead+=1
|
||||
if ElevatorPositionY>=Leveling[Attributes.CurrentFloor.Value+1] then
|
||||
Attributes.CurrentFloor.Value+=1
|
||||
|
||||
if Attributes.CurrentFloor.Value ~= RequestedLevel then
|
||||
self.LanternsConstructor:Toggle(true, Attributes.CurrentFloor.Value)
|
||||
self.LanternsConstructor:Toggle(false, Attributes.CurrentFloor.Value-1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
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
|
||||
|
||||
function Otis1960:__MoveFloors(GoalLevelVEC, RequestedLevel, GoingUp)
|
||||
@@ -271,8 +272,6 @@ function Otis1960:__MoveFloors(GoalLevelVEC, RequestedLevel, GoingUp)
|
||||
local DoorsOpeningEvent = false
|
||||
local ElevatorBoxCurrentPos = self.ElevatorBox_1960.Position
|
||||
|
||||
FloorPassingLookAhead = Attributes.CurrentFloor.Value
|
||||
|
||||
--Otis1960_ShaftGovernor
|
||||
self.__MovingConnection = RS.Heartbeat:Connect(function(_dt)
|
||||
Delta+=1
|
||||
|
||||
Reference in New Issue
Block a user