This commit is contained in:
2024-03-11 02:17:24 -04:00
parent df86e6efb6
commit fc1f2bd9ee
2 changed files with 89 additions and 17 deletions

View File

@@ -9,7 +9,9 @@ local TagsModule = require(RS:WaitForChild("Tags"))
local Leveling = require(script:WaitForChild("Leveling"))
local Doors = require(script:WaitForChild("Doors"))
local ElevatorMover = require(Elevators:WaitForChild("Mover"))
local ButtonTags = require(Elevators:WaitForChild("Buttons"))
type Tags = TagsModule.ExportedTags
@@ -39,20 +41,6 @@ type Constructor_Return_Props = {
local Otis1960 = {} :: Impl_Constructor
Otis1960.__index = Otis1960
local function PromptButtons(self: Constructor_Return_Props)
for i: number = 1, #self.ProximityButtons do
local Button = self.ProximityButtons[i]
local Attachment = Instance.new("Attachment") :: Attachment
Attachment.Parent = Button
local Prompt = Instance.new("ProximityPrompt") :: ProximityPrompt
Prompt.MaxActivationDistance = 3
Prompt.Parent = Attachment
print(`Created a ProximityPrompt @ "{Button:GetFullName()}"`)
end
end
function Otis1960.constructor(Tags)
local self = {} :: Constructor_Return_Props
self.ElevatorBox_1960 = Tags.ElevatorMover_1960 :: BasePart
@@ -65,15 +53,17 @@ function Otis1960.constructor(Tags)
self.BoxAttachment, self.BoxAlignPosition, self.BoxAlignOrientation = ElevatorMover(self.ElevatorBox_1960, self.ElevatorBox_1960.Position)
self.ElevatorDoors = Doors.constructor(self.ElevatorBox, self.ElevatorDoor1, self.ElevatorDoor2, self.ElevatorDoorSensor)
PromptButtons(self)
print("Otis1960 initialized and ready")
--Buttons
local Buttons = ButtonTags.constructor(Tags, "Otis1960")
local Otis1960_Buttons = Buttons:CreatePromptButtons()
print("[DEBUG] Otis1960 Buttons=", Otis1960_Buttons)
print("🔝 Otis1960 initialized and ready")
return setmetatable(self, Otis1960)
end
function Otis1960:MoveFloors(Level)
local ElevatorBoxCurrentPos = self.ElevatorBox.Position
--Its gonna use raycasting inside of the shaft to detect when its near and when to stop
self.BoxAlignPosition.Position = Vector3.new(ElevatorBoxCurrentPos.X, Level, ElevatorBoxCurrentPos.Z)
end