Working door close, TODO: Branch out the Algebra module into its own custom math tweening on vacation trip

This commit is contained in:
2024-08-28 23:10:52 -04:00
parent f32cb30df8
commit 12fa7badda
4 changed files with 125 additions and 13 deletions

View File

@@ -2,6 +2,9 @@
--!native
--!strict
local ButtonPromptsDistance = Vector3.new(-.05,0,0)
local HallDoorOffset = Vector3.new(4.15,0,0)
local ParentDir = script.Parent
local ElevatorsDir = ParentDir.Parent
local MainDir = ElevatorsDir.Parent
@@ -13,7 +16,9 @@ local Buttons = require(script:WaitForChild("Buttons"))
local Leveling = require(script:WaitForChild("Leveling"))
local MovingObjects = require(script:WaitForChild("MovingObjects"))
local TractionRopes = require(script:WaitForChild("TractionRopes"))
local Doors = require(script:WaitForChild("Doors"))
local TagsModule = require(MainDir:WaitForChild("Map"):WaitForChild("Load"):WaitForChild("Tags"))
local DoorEnums = require(MainDir:WaitForChild("Types"):WaitForChild("Enums"):WaitForChild("Doors"))
return function(TagsConstructor: TagsModule.TagsConstructor, ButtonTags: TagsModule.ElevatorButtons, LanternTags: TagsModule.Lanterns, LandingDoorTags: TagsModule.LandingTags)
local ElevatorModel = TagsConstructor:Request("Elevator_Haughton") :: Model
@@ -21,9 +26,14 @@ return function(TagsConstructor: TagsModule.TagsConstructor, ButtonTags: TagsMod
local PulleyRopesObject = TagsConstructor:Request("Haughton_Rope_Pulley") :: BasePart
local ElevatorBoxModel = ElevatorModel:WaitForChild("Mover") :: BasePart
--TEMP
local CabDoorsTree = {} :: {BasePart}
local Elevator = InitElevator.constructor(ElevatorBoxModel, Config, Leveling)
local MovingObjectsConstructor = MovingObjects.constructor(TagsConstructor)
local ButtonsConstructor = Buttons.constructor(Config.Name, ButtonTags, Elevator.Attributes.CurrentFloor)
ButtonsConstructor:InitForElevator(2, ButtonPromptsDistance)
local TractionRopesConstructor = TractionRopes.constructor(CabRopesObject, PulleyRopesObject)
local EventsConstructor = Events.constructor(
Elevator,
@@ -34,7 +44,9 @@ return function(TagsConstructor: TagsModule.TagsConstructor, ButtonTags: TagsMod
MovingObjectsConstructor,
TractionRopesConstructor
)
EventsConstructor:InitButtons()
ButtonsConstructor:InitForElevator(2, Vector3.new(-.05,0,0))
local DoorsConstructor = Doors.constructor(ElevatorBoxModel, DoorEnums.Door.SingleSpeed, CabDoorsTree, DoorEnums.Door.SingleSpeed, LandingDoorTags)
task.wait(2)
DoorsConstructor:CloseFloorAsync(1, HallDoorOffset)
end