mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-14 06:41:55 +00:00
work on lanterns, doors now properly open
This commit is contained in:
@@ -23,7 +23,9 @@ type Impl_Constructor = {
|
|||||||
--Class functions
|
--Class functions
|
||||||
DecodeCarTag: (self: ClassConstructor, FloorTag: string) -> number?,
|
DecodeCarTag: (self: ClassConstructor, FloorTag: string) -> number?,
|
||||||
CreatePromptButtons: (self: ClassConstructor) -> Tags.ButtonsTree,
|
CreatePromptButtons: (self: ClassConstructor) -> Tags.ButtonsTree,
|
||||||
AestheticActivateButton: (self: ClassConstructor, Button: BasePart, ActivatedState: boolean, ActivatedColor: Color3) -> thread
|
AestheticActivateButton: (self: ClassConstructor, Button: BasePart, ActivatedColor: Color3) -> (),
|
||||||
|
DeactivateButton: (self: ClassConstructor, Button: BasePart, DeactivatedColor: Color3) -> (),
|
||||||
|
ActivateButton: (self: ClassConstructor, Button: BasePart, ActivatedColor: Color3) -> (),
|
||||||
} & Impl_Static_Props
|
} & Impl_Static_Props
|
||||||
|
|
||||||
type Impl_Static_Props = {
|
type Impl_Static_Props = {
|
||||||
@@ -143,28 +145,38 @@ function ButtonsModule:CreatePromptButtons()
|
|||||||
return self.Buttons
|
return self.Buttons
|
||||||
end
|
end
|
||||||
|
|
||||||
function ButtonsModule:AestheticActivateButton(Button, ActivatedState, ActivatedColor)
|
function ButtonsModule:DeactivateButton(Button, DeactivatedColor)
|
||||||
return task.spawn(function()
|
local Glass = Button:FindFirstChild("Glass") :: BasePart?
|
||||||
local Glass = Button:FindFirstChild("Glass") :: BasePart
|
local Part = Glass and Glass or Button
|
||||||
local LookVec = Glass.CFrame.LookVector/50
|
|
||||||
if Glass then
|
|
||||||
Glass.Position+=LookVec
|
|
||||||
|
|
||||||
if not ActivatedState then
|
Part.Material = Enum.Material.Glass
|
||||||
Glass.Material = Enum.Material.Neon
|
Part.Color = DeactivatedColor
|
||||||
Glass.Color = ActivatedColor
|
Part.Transparency = 0.3
|
||||||
Glass.Transparency = 0
|
end
|
||||||
end
|
|
||||||
end
|
|
||||||
Button.Position+=LookVec
|
|
||||||
|
|
||||||
task.wait(.30)
|
function ButtonsModule:ActivateButton(Button, ActivatedColor)
|
||||||
|
local Glass = Button:FindFirstChild("Glass") :: BasePart?
|
||||||
|
local Part = Glass and Glass or Button
|
||||||
|
|
||||||
if Glass then
|
Part.Material = Enum.Material.Neon
|
||||||
Glass.Position-=LookVec
|
Part.Color = ActivatedColor
|
||||||
end
|
Part.Transparency = 0
|
||||||
Button.Position-=LookVec
|
end
|
||||||
end)
|
|
||||||
|
function ButtonsModule:AestheticActivateButton(Button, ActivatedColor)
|
||||||
|
local Glass = Button:FindFirstChild("Glass") :: BasePart?
|
||||||
|
local LookVec = (Glass and Glass or Button).CFrame.LookVector/50
|
||||||
|
if Glass then
|
||||||
|
Glass.Position+=LookVec
|
||||||
|
self:ActivateButton(Glass, ActivatedColor)
|
||||||
|
end
|
||||||
|
|
||||||
|
Button.Position+=LookVec
|
||||||
|
task.wait(.30)
|
||||||
|
if Glass then
|
||||||
|
Glass.Position-=LookVec
|
||||||
|
end
|
||||||
|
Button.Position-=LookVec
|
||||||
end
|
end
|
||||||
|
|
||||||
return ButtonsModule
|
return ButtonsModule
|
||||||
@@ -20,11 +20,11 @@ type Impl_Constructor = {
|
|||||||
constructor: Constructor_Fun,
|
constructor: Constructor_Fun,
|
||||||
Get: (Tags: Tags.TagsConstructor, Model: Enums.ElevatorValues) -> Tags.Lanterns,
|
Get: (Tags: Tags.TagsConstructor, Model: Enums.ElevatorValues) -> Tags.Lanterns,
|
||||||
--Class functions
|
--Class functions
|
||||||
Activate: (self: ClassConstructor, EnabledState: boolean, IsDirectionLantern: boolean, Lantern: Lantern) -> (),
|
Activate: (self: ClassConstructor, EnabledState: boolean, IsDirectionLantern: boolean, Lantern: Tags.Lantern) -> (),
|
||||||
DirectionUp: (self: ClassConstructor, Enabled: boolean) -> (),
|
DirectionUp: (self: ClassConstructor, Enabled: boolean) -> (),
|
||||||
DirectionDown: (self: ClassConstructor, Enabled: boolean) -> (),
|
DirectionDown: (self: ClassConstructor, Enabled: boolean) -> (),
|
||||||
Toggle: (self: ClassConstructor, Enabled: boolean, Floor: number) -> (),
|
Toggle: (self: ClassConstructor, Enabled: boolean, Floor: number) -> (),
|
||||||
Reset: (self: ClassConstructor) -> ()
|
Reset: (self: ClassConstructor, ExcludeFloor: number?) -> ()
|
||||||
} & Impl_Static_Props
|
} & Impl_Static_Props
|
||||||
|
|
||||||
type Impl_Static_Props = {
|
type Impl_Static_Props = {
|
||||||
@@ -40,12 +40,6 @@ type Constructor_Return_Props = {
|
|||||||
Colors: Colors
|
Colors: Colors
|
||||||
}
|
}
|
||||||
|
|
||||||
type Lantern = {
|
|
||||||
Inst: BasePart,
|
|
||||||
Light: BasePart?,
|
|
||||||
Played: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
export type Colors = {
|
export type Colors = {
|
||||||
Active: Color3,
|
Active: Color3,
|
||||||
Off: Color3
|
Off: Color3
|
||||||
@@ -93,10 +87,27 @@ function Lanterns:Activate(EnabledState, IsDirectionLantern, Lantern)
|
|||||||
self.AudioChimeLanding:Play()
|
self.AudioChimeLanding:Play()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if Lantern.PointLight then
|
||||||
|
Lantern.PointLight.Enabled = true
|
||||||
|
LanternLight:Start(Lantern.PointLight, {
|
||||||
|
Color = self.Colors.Active
|
||||||
|
})
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if Lantern.PointLight then
|
||||||
|
local LightTween = LanternLight:Start(Lantern.PointLight, {
|
||||||
|
Color = Color3.new(0,0,0)
|
||||||
|
})
|
||||||
|
|
||||||
|
LightTween.Completed:Once(function()
|
||||||
|
Lantern.PointLight.Enabled = false
|
||||||
|
end)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Lanterns:Reset()
|
function Lanterns:Reset(ExcludeFloor)
|
||||||
if self.LanternsMap.Up then
|
if self.LanternsMap.Up then
|
||||||
self.LanternsMap.Up.Played = false
|
self.LanternsMap.Up.Played = false
|
||||||
self:Activate(false, true, self.LanternsMap.Up)
|
self:Activate(false, true, self.LanternsMap.Up)
|
||||||
@@ -107,8 +118,10 @@ function Lanterns:Reset()
|
|||||||
end
|
end
|
||||||
|
|
||||||
for n: number = 1, #self.LanternsMap do
|
for n: number = 1, #self.LanternsMap do
|
||||||
self:Activate(false, false, self.LanternsMap[n])
|
local Lantern = self.LanternsMap[n]
|
||||||
self.LanternsMap[n].Played = false
|
|
||||||
|
self:Activate(ExcludeFloor and n == ExcludeFloor or false, false, Lantern)
|
||||||
|
Lantern.Played = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -116,10 +116,10 @@ local function DoorsAnimationFloor(FloorDoors: {Instance?}, Floor: number, openi
|
|||||||
|
|
||||||
if not (init_floors_closed[Floor] :: {})[1] and not (init_floors_closed[Floor] :: {})[2] then
|
if not (init_floors_closed[Floor] :: {})[1] and not (init_floors_closed[Floor] :: {})[2] then
|
||||||
if FloorDoor1_P then
|
if FloorDoor1_P then
|
||||||
(init_floors_closed[Floor] :: {})[1] = FloorDoor1_P+Doors.Door1Stopped_X
|
(init_floors_closed[Floor] :: {})[1] = FloorDoor1_P-Doors.Door1Stopped_X
|
||||||
end
|
end
|
||||||
if FloorDoor2_P then
|
if FloorDoor2_P then
|
||||||
(init_floors_closed[Floor] :: {})[2] = FloorDoor2_P+Doors.Door2Stopped_X
|
(init_floors_closed[Floor] :: {})[2] = FloorDoor2_P-Doors.Door2Stopped_X
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@@ -175,7 +175,7 @@ local function ElevatorDoorsAnimation(self: ClassConstructor, opening: boolean?,
|
|||||||
if opening then
|
if opening then
|
||||||
--This is mega cringe but the doors can open while the elevator is moving now
|
--This is mega cringe but the doors can open while the elevator is moving now
|
||||||
local StartTime = os.clock()
|
local StartTime = os.clock()
|
||||||
local Timing = 2
|
local Timing = Doors.ElevatorDoorTime-1
|
||||||
|
|
||||||
while task.wait() do
|
while task.wait() do
|
||||||
local Time = math.clamp((os.clock()-StartTime)/Timing, 0, 1)
|
local Time = math.clamp((os.clock()-StartTime)/Timing, 0, 1)
|
||||||
@@ -184,19 +184,18 @@ local function ElevatorDoorsAnimation(self: ClassConstructor, opening: boolean?,
|
|||||||
local Door1Vector = Vector3.new(ElevatorDoor1_P.X, 0, ElevatorDoor1_P.Z)
|
local Door1Vector = Vector3.new(ElevatorDoor1_P.X, 0, ElevatorDoor1_P.Z)
|
||||||
local Door2Vector = Vector3.new(ElevatorDoor2_P.X, 0, ElevatorDoor2_P.Z)
|
local Door2Vector = Vector3.new(ElevatorDoor2_P.X, 0, ElevatorDoor2_P.Z)
|
||||||
|
|
||||||
self.ElevatorDoor1.Position = ElevatorBoxY+ElevatorDoor1_P:Lerp(Door1Vector+Doors.Door1Stopped_X, Time)
|
self.ElevatorDoor1.Position = ElevatorBoxY+Door1Vector:Lerp(Door1Vector-Doors.Door1Stopped_X, Time)
|
||||||
self.ElevatorDoor2.Position = ElevatorBoxY+ElevatorDoor2_P:Lerp(Door2Vector+Doors.Door2Stopped_X, Time)
|
self.ElevatorDoor2.Position = ElevatorBoxY+Door2Vector:Lerp(Door2Vector-Doors.Door2Stopped_X, Time)
|
||||||
|
|
||||||
if Time>=1 then
|
if Time>=1 then
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
||||||
local TweenTime = activated_via_censor and sensor_opening_speed or opening and opening_speed or Doors.ElevatorDoorTime
|
local TweenTime = activated_via_censor and sensor_opening_speed or opening and opening_speed or Doors.ElevatorDoorTime
|
||||||
|
|
||||||
local Door1Tween = self.DoorTween1:Start(nil, {
|
local Door1Tween = self.DoorTween1:Start(nil, {
|
||||||
Position = ElevatorDoor1_P-Doors.Door1Stopped_X
|
Position = ElevatorDoor1_P+Doors.Door1Stopped_X
|
||||||
}, TweenInfo.new(
|
}, TweenInfo.new(
|
||||||
TweenTime,
|
TweenTime,
|
||||||
activated_via_censor and Enum.EasingStyle.Linear or Doors.ElevatorDoorStyle,
|
activated_via_censor and Enum.EasingStyle.Linear or Doors.ElevatorDoorStyle,
|
||||||
@@ -204,7 +203,7 @@ local function ElevatorDoorsAnimation(self: ClassConstructor, opening: boolean?,
|
|||||||
))
|
))
|
||||||
|
|
||||||
local Door2Tween = self.DoorTween2:Start(nil, {
|
local Door2Tween = self.DoorTween2:Start(nil, {
|
||||||
Position = ElevatorDoor2_P-Doors.Door2Stopped_X
|
Position = ElevatorDoor2_P+Doors.Door2Stopped_X
|
||||||
}, TweenInfo.new(
|
}, TweenInfo.new(
|
||||||
TweenTime,
|
TweenTime,
|
||||||
activated_via_censor and Enum.EasingStyle.Linear or Doors.ElevatorDoorStyle,
|
activated_via_censor and Enum.EasingStyle.Linear or Doors.ElevatorDoorStyle,
|
||||||
@@ -216,15 +215,13 @@ local function ElevatorDoorsAnimation(self: ClassConstructor, opening: boolean?,
|
|||||||
end
|
end
|
||||||
Doors.__DontLeakMemory = self:__DetectSensorHit(Door1Tween, Door2Tween)
|
Doors.__DontLeakMemory = self:__DetectSensorHit(Door1Tween, Door2Tween)
|
||||||
|
|
||||||
if not opening then
|
--Door clicking noise
|
||||||
--Door clicking noise
|
task.delay(Doors.ElevatorDoorTime-.90, function()
|
||||||
task.delay(Doors.ElevatorDoorTime-.90, function()
|
--is the door close enough to closing?
|
||||||
--is the door close enough to closing?
|
if (Doors.Door2Stopped_X-ElevatorDoor2_P).X-self.ElevatorDoor2.Position.X>10 then
|
||||||
if (ElevatorDoor2_P+Doors.Door2Stopped_X).X-self.ElevatorDoor2.Position.X>5 then
|
self.DoorClosingClick:Play()
|
||||||
self.DoorClosingClick:Play()
|
end
|
||||||
end
|
end)
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
return Door2Tween
|
return Door2Tween
|
||||||
end
|
end
|
||||||
@@ -285,7 +282,10 @@ function Doors:ToggleElevatorDoors(opening, floor)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local FloorDoors = DoorsAnimationFloor(self.FloorDoorsTags[floor], floor, opening)
|
local FloorDoorsObjects = self.FloorDoorsTags[floor]
|
||||||
|
if FloorDoorsObjects then
|
||||||
|
DoorsAnimationFloor(FloorDoorsObjects, floor, opening)
|
||||||
|
end
|
||||||
local Door2Tween = ElevatorDoorsAnimation(self, opening)
|
local Door2Tween = ElevatorDoorsAnimation(self, opening)
|
||||||
|
|
||||||
if Door2Tween then
|
if Door2Tween then
|
||||||
@@ -294,7 +294,7 @@ function Doors:ToggleElevatorDoors(opening, floor)
|
|||||||
self.ElevatorDoor1.CanCollide = true
|
self.ElevatorDoor1.CanCollide = true
|
||||||
self.ElevatorDoor2.CanCollide = true
|
self.ElevatorDoor2.CanCollide = true
|
||||||
|
|
||||||
if Doors.__DontLeakMemory then
|
if Doors.__DontLeakMemory and Doors.__DontLeakMemory.Connected then
|
||||||
Doors.__DontLeakMemory:Disconnect()
|
Doors.__DontLeakMemory:Disconnect()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ type Impl_Static_Props = {
|
|||||||
Responsiveness: number,
|
Responsiveness: number,
|
||||||
MaxVelocity: number,
|
MaxVelocity: number,
|
||||||
ButtonActivatedColor: Color3,
|
ButtonActivatedColor: Color3,
|
||||||
|
ButtonDeactivatedColor: Color3,
|
||||||
LanternDisplayColorOn: Color3,
|
LanternDisplayColorOn: Color3,
|
||||||
LanternDisplayColorOff: Color3,
|
LanternDisplayColorOff: Color3,
|
||||||
LanternChimeDirection: rbxassetid,
|
LanternChimeDirection: rbxassetid,
|
||||||
@@ -90,6 +91,7 @@ Otis1960.LeveledDistance = 0.5
|
|||||||
Otis1960.Responsiveness = 50
|
Otis1960.Responsiveness = 50
|
||||||
Otis1960.MaxVelocity = 10
|
Otis1960.MaxVelocity = 10
|
||||||
Otis1960.ButtonActivatedColor = Color3.fromRGB(180,0,0)
|
Otis1960.ButtonActivatedColor = Color3.fromRGB(180,0,0)
|
||||||
|
Otis1960.ButtonDeactivatedColor = Color3.fromRGB(139,139,139)
|
||||||
Otis1960.LanternDisplayColorOn = Color3.fromRGB(255,114,71)
|
Otis1960.LanternDisplayColorOn = Color3.fromRGB(255,114,71)
|
||||||
Otis1960.LanternDisplayColorOff = Color3.fromRGB(55,55,55)
|
Otis1960.LanternDisplayColorOff = Color3.fromRGB(55,55,55)
|
||||||
Otis1960.LanternChimeDirection = "rbxassetid://16990287228"
|
Otis1960.LanternChimeDirection = "rbxassetid://16990287228"
|
||||||
@@ -111,10 +113,21 @@ local ButtonFunctions: ButtonFunctions = {
|
|||||||
|
|
||||||
Prompt:AddHookTriggered(function(Player: Player)
|
Prompt:AddHookTriggered(function(Player: Player)
|
||||||
if DecodedFloor then
|
if DecodedFloor then
|
||||||
local _ButtonThread = ButtonsConstructor:AestheticActivateButton(ButtonTree.Inst :: BasePart, false, Otis1960.ButtonActivatedColor)
|
task.spawn(function()
|
||||||
self:GoToLevel(DecodedFloor)
|
ButtonsConstructor:AestheticActivateButton(ButtonTree.Inst :: BasePart, Otis1960.ButtonActivatedColor)
|
||||||
|
|
||||||
|
if DecodedFloor == Otis1960.__CurrentFloor then
|
||||||
|
ButtonsConstructor:DeactivateButton(ButtonTree.Inst :: BasePart, Otis1960.ButtonDeactivatedColor)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
if DecodedFloor ~= Otis1960.__CurrentFloor then
|
||||||
|
self:GoToLevel(DecodedFloor)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
else
|
||||||
|
warn(`Otis1960: Failed to decode car button, ButtonName={ButtonName}`)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
@@ -205,7 +218,7 @@ local function FloorLeveled(self: ClassConstructor, RequestedLevel: number)
|
|||||||
Otis1960.__CurrentFloor = RequestedLevel
|
Otis1960.__CurrentFloor = RequestedLevel
|
||||||
self.BoxAlignPosition.MaxVelocity = Otis1960.MaxVelocity
|
self.BoxAlignPosition.MaxVelocity = Otis1960.MaxVelocity
|
||||||
|
|
||||||
self.LanternsConstructor:Reset()
|
self.LanternsConstructor:Reset(Otis1960.__CurrentFloor)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Otis1960:__MoveFloors(GoalLevelVEC, RequestedLevel, GoingUp)
|
function Otis1960:__MoveFloors(GoalLevelVEC, RequestedLevel, GoingUp)
|
||||||
@@ -238,7 +251,7 @@ function Otis1960:__MoveFloors(GoalLevelVEC, RequestedLevel, GoingUp)
|
|||||||
local ElevatorVelocityY: number = self.ElevatorBox_1960:GetVelocityAtPosition(ElevatorPosition).Y
|
local ElevatorVelocityY: number = self.ElevatorBox_1960:GetVelocityAtPosition(ElevatorPosition).Y
|
||||||
|
|
||||||
self.MOConstructor:Frame_Pullies(Delta, ElevatorVelocityY)
|
self.MOConstructor:Frame_Pullies(Delta, ElevatorVelocityY)
|
||||||
self.TractionRopes:Move(26.3, ElevatorPosition)
|
self.TractionRopes:Move(27, ElevatorPosition)
|
||||||
|
|
||||||
--Kill the connection
|
--Kill the connection
|
||||||
if GoingUp then
|
if GoingUp then
|
||||||
@@ -257,6 +270,11 @@ function Otis1960:__MoveFloors(GoalLevelVEC, RequestedLevel, GoingUp)
|
|||||||
else
|
else
|
||||||
if ElevatorPositionY<=BoxAlignY+Otis1960.FloorLevelingDistance then
|
if ElevatorPositionY<=BoxAlignY+Otis1960.FloorLevelingDistance then
|
||||||
FloorLeveling(self, RequestedLevel)
|
FloorLeveling(self, RequestedLevel)
|
||||||
|
|
||||||
|
if ElevatorPositionY>=BoxAlignY-Otis1960.DoorOpeningDistance and not DoorsOpeningEvent then
|
||||||
|
DoorsOpeningEvent = true
|
||||||
|
self.ElevatorDoors:ToggleElevatorDoors(true, RequestedLevel)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if ElevatorPositionY<=BoxAlignY+Otis1960.LeveledDistance then
|
if ElevatorPositionY<=BoxAlignY+Otis1960.LeveledDistance then
|
||||||
@@ -273,6 +291,7 @@ function Otis1960:GoToLevel(RequestedLevel)
|
|||||||
|
|
||||||
if GoalLevelVEC and GoalLevelVEC ~= 0 and GoalLevelVEC ~= Otis1960.__CurrentFloor then
|
if GoalLevelVEC and GoalLevelVEC ~= 0 and GoalLevelVEC ~= Otis1960.__CurrentFloor then
|
||||||
local GoingUp: boolean = -(Otis1960.__CurrentFloor-RequestedLevel)>0 --My clever math function for determining if the elevator goal is to move upwards or not
|
local GoingUp: boolean = -(Otis1960.__CurrentFloor-RequestedLevel)>0 --My clever math function for determining if the elevator goal is to move upwards or not
|
||||||
|
|
||||||
self:__MoveFloors(GoalLevelVEC, RequestedLevel, GoingUp)
|
self:__MoveFloors(GoalLevelVEC, RequestedLevel, GoingUp)
|
||||||
else
|
else
|
||||||
warn(`[{Enums.Elevator.Otis1960}]: landing out of range or equals the same range as goal! requested landing: {tostring(RequestedLevel)}`)
|
warn(`[{Enums.Elevator.Otis1960}]: landing out of range or equals the same range as goal! requested landing: {tostring(RequestedLevel)}`)
|
||||||
|
|||||||
@@ -34,9 +34,10 @@ type Constructor_Return_Props = {
|
|||||||
__export: ExportedTags
|
__export: ExportedTags
|
||||||
}
|
}
|
||||||
|
|
||||||
type Lantern = {
|
export type Lantern = {
|
||||||
Inst: BasePart,
|
Inst: BasePart,
|
||||||
Light: BasePart?,
|
Light: BasePart?,
|
||||||
|
PointLight: PointLight?,
|
||||||
Played: boolean
|
Played: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,26 +184,35 @@ function Tags:__ElevatorLanterns()
|
|||||||
|
|
||||||
if Floor then
|
if Floor then
|
||||||
if not Lanterns[EnumValue :: Enums.ElevatorValues][Floor] then
|
if not Lanterns[EnumValue :: Enums.ElevatorValues][Floor] then
|
||||||
|
local Light = ((Inst :: BasePart).Parent :: Instance):FindFirstChild("Light") :: BasePart?
|
||||||
|
|
||||||
Lanterns[EnumValue :: Enums.ElevatorValues][Floor] = {
|
Lanterns[EnumValue :: Enums.ElevatorValues][Floor] = {
|
||||||
Inst = Inst :: BasePart,
|
Inst = Inst :: BasePart,
|
||||||
Light = ((Inst :: BasePart).Parent :: Instance):FindFirstChild("Light") :: BasePart?,
|
Light = Light,
|
||||||
Played = false
|
PointLight = Light and Light:FindFirstChildOfClass("PointLight") :: PointLight?,
|
||||||
|
Played = false
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
warn(`Lanterns: Floor "{tostring(Floor)}" was already wrote while parsing`)
|
warn(`Lanterns: Floor "{tostring(Floor)}" was already wrote while parsing`)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if FloorHint == "Up" then
|
if FloorHint == "Up" then
|
||||||
|
local Light = ((Inst :: BasePart).Parent :: Instance):FindFirstChild("Light") :: BasePart?
|
||||||
|
|
||||||
Lanterns[EnumValue :: Enums.ElevatorValues].Up = {
|
Lanterns[EnumValue :: Enums.ElevatorValues].Up = {
|
||||||
Inst = Inst :: BasePart,
|
Inst = Inst :: BasePart,
|
||||||
Light = ((Inst :: BasePart).Parent :: Instance):FindFirstChild("Light") :: BasePart?,
|
Light = Light,
|
||||||
Played = false
|
PointLight = Light and Light:FindFirstChildOfClass("PointLight") :: PointLight?,
|
||||||
|
Played = false
|
||||||
}
|
}
|
||||||
elseif FloorHint == "Down" then
|
elseif FloorHint == "Down" then
|
||||||
|
local Light = ((Inst :: BasePart).Parent :: Instance):FindFirstChild("Light") :: BasePart?
|
||||||
|
|
||||||
Lanterns[EnumValue :: Enums.ElevatorValues].Down = {
|
Lanterns[EnumValue :: Enums.ElevatorValues].Down = {
|
||||||
Inst = Inst :: BasePart,
|
Inst = Inst :: BasePart,
|
||||||
Light = ((Inst :: BasePart).Parent :: Instance):FindFirstChild("Light") :: BasePart?,
|
Light = Light,
|
||||||
Played = false
|
PointLight = Light and Light:FindFirstChildOfClass("PointLight") :: PointLight?,
|
||||||
|
Played = false
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
warn(`Lanterns: Unknown type paired with "DirectionIndicator", {FloorHint}`)
|
warn(`Lanterns: Unknown type paired with "DirectionIndicator", {FloorHint}`)
|
||||||
|
|||||||
Reference in New Issue
Block a user