mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-14 14:51:55 +00:00
work on lanterns, doors now properly open
This commit is contained in:
@@ -20,11 +20,11 @@ type Impl_Constructor = {
|
||||
constructor: Constructor_Fun,
|
||||
Get: (Tags: Tags.TagsConstructor, Model: Enums.ElevatorValues) -> Tags.Lanterns,
|
||||
--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) -> (),
|
||||
DirectionDown: (self: ClassConstructor, Enabled: boolean) -> (),
|
||||
Toggle: (self: ClassConstructor, Enabled: boolean, Floor: number) -> (),
|
||||
Reset: (self: ClassConstructor) -> ()
|
||||
Reset: (self: ClassConstructor, ExcludeFloor: number?) -> ()
|
||||
} & Impl_Static_Props
|
||||
|
||||
type Impl_Static_Props = {
|
||||
@@ -40,12 +40,6 @@ type Constructor_Return_Props = {
|
||||
Colors: Colors
|
||||
}
|
||||
|
||||
type Lantern = {
|
||||
Inst: BasePart,
|
||||
Light: BasePart?,
|
||||
Played: boolean
|
||||
}
|
||||
|
||||
export type Colors = {
|
||||
Active: Color3,
|
||||
Off: Color3
|
||||
@@ -93,10 +87,27 @@ function Lanterns:Activate(EnabledState, IsDirectionLantern, Lantern)
|
||||
self.AudioChimeLanding:Play()
|
||||
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
|
||||
|
||||
function Lanterns:Reset()
|
||||
function Lanterns:Reset(ExcludeFloor)
|
||||
if self.LanternsMap.Up then
|
||||
self.LanternsMap.Up.Played = false
|
||||
self:Activate(false, true, self.LanternsMap.Up)
|
||||
@@ -107,8 +118,10 @@ function Lanterns:Reset()
|
||||
end
|
||||
|
||||
for n: number = 1, #self.LanternsMap do
|
||||
self:Activate(false, false, self.LanternsMap[n])
|
||||
self.LanternsMap[n].Played = false
|
||||
local Lantern = self.LanternsMap[n]
|
||||
|
||||
self:Activate(ExcludeFloor and n == ExcludeFloor or false, false, Lantern)
|
||||
Lantern.Played = false
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user