mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-14 14:51:55 +00:00
pie plate selector and all floor positions specified
This commit is contained in:
@@ -5,13 +5,13 @@
|
|||||||
local Leveling: {number} = {
|
local Leveling: {number} = {
|
||||||
[1] = 13.041,
|
[1] = 13.041,
|
||||||
[2] = 37.973,
|
[2] = 37.973,
|
||||||
[3] = 0,
|
[3] = 62.978,
|
||||||
[4] = 0,
|
[4] = 87.968,
|
||||||
[5] = 0,
|
[5] = 112.952,
|
||||||
[6] = 0,
|
[6] = 137.988,
|
||||||
[7] = 0,
|
[7] = 163.009,
|
||||||
[8] = 0,
|
[8] = 188.007,
|
||||||
[9] = 0,
|
[9] = 213.058,
|
||||||
[10] = 239.245
|
[10] = 239.245
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
32
src/server/main/Elevators/Otis1960/PiePlateSelector.lua
Normal file
32
src/server/main/Elevators/Otis1960/PiePlateSelector.lua
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
local PieplateSelectorModule = {}
|
||||||
|
PieplateSelectorModule.__index = PieplateSelectorModule
|
||||||
|
|
||||||
|
local RS: RunService = game:GetService("RunService")
|
||||||
|
|
||||||
|
function PieplateSelectorModule.constructor(PieplateSelector: UnionOperation, PiePlatePlates: UnionOperation, ElevatorBox: UnionOperation)
|
||||||
|
return setmetatable({
|
||||||
|
PieplateSelector = PieplateSelector,
|
||||||
|
PiePlatePlates = PiePlatePlates,
|
||||||
|
ElevatorBox = ElevatorBox
|
||||||
|
}, PieplateSelectorModule)
|
||||||
|
end
|
||||||
|
|
||||||
|
function PieplateSelectorModule:test()
|
||||||
|
local Delta = 0
|
||||||
|
|
||||||
|
self.PieplateSelector.CFrame=self.PieplateSelector.CFrame+Vector3.yAxis/20
|
||||||
|
|
||||||
|
local OriginalAngleDelta = self.PiePlatePlates.CFrame
|
||||||
|
local OriginalPositionDelta = self.PieplateSelector.CFrame
|
||||||
|
|
||||||
|
self.__SelectorConnection = RS.Heartbeat:Connect(function(_dt)
|
||||||
|
Delta+=1
|
||||||
|
|
||||||
|
self.PieplateSelector.CFrame=OriginalPositionDelta+Vector3.new(0, Delta/500, 0)
|
||||||
|
self.PiePlatePlates.CFrame=OriginalAngleDelta*CFrame.Angles(-math.rad(Delta*6.8), 0, 0)
|
||||||
|
end)
|
||||||
|
|
||||||
|
return self.__SelectorConnection
|
||||||
|
end
|
||||||
|
|
||||||
|
return PieplateSelectorModule
|
||||||
@@ -11,6 +11,7 @@ local TagsModule = require(Storage:WaitForChild("Tags"))
|
|||||||
|
|
||||||
local Leveling = require(script:WaitForChild("Leveling"))
|
local Leveling = require(script:WaitForChild("Leveling"))
|
||||||
local Doors = require(script:WaitForChild("Doors"))
|
local Doors = require(script:WaitForChild("Doors"))
|
||||||
|
local PieplateModule = require(script:WaitForChild("PiePlateSelector"))
|
||||||
|
|
||||||
local Enums = require(Elevators:WaitForChild("Enums"))
|
local Enums = require(Elevators:WaitForChild("Enums"))
|
||||||
local ElevatorMover = require(Elevators:WaitForChild("Mover"))
|
local ElevatorMover = require(Elevators:WaitForChild("Mover"))
|
||||||
@@ -97,6 +98,11 @@ local function HookButtons(self: ClassConstructor, ButtonsConstructor: ButtonTag
|
|||||||
self:GoToLevel(DecodedFloor)
|
self:GoToLevel(DecodedFloor)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
if DecodedFloor == 10 then
|
||||||
|
task.wait(5)
|
||||||
|
self:GoToLevel(DecodedFloor)
|
||||||
|
end
|
||||||
elseif ButtonNameType == Enums.ButtonTree.Special then
|
elseif ButtonNameType == Enums.ButtonTree.Special then
|
||||||
|
|
||||||
elseif ButtonNameType == Enums.ButtonTree.Landing then
|
elseif ButtonNameType == Enums.ButtonTree.Landing then
|
||||||
@@ -127,6 +133,7 @@ function Otis1960.constructor(Tags)
|
|||||||
self.ProximityButtons = Tags.ProximityElevatorButton :: {Instance}
|
self.ProximityButtons = Tags.ProximityElevatorButton :: {Instance}
|
||||||
self.Ropes = Tags["1960_ElevatorPulleyRope"] :: {Instance}
|
self.Ropes = Tags["1960_ElevatorPulleyRope"] :: {Instance}
|
||||||
self.PiePlateSelector = Tags.Otis1960_PiePlateSelector :: UnionOperation
|
self.PiePlateSelector = Tags.Otis1960_PiePlateSelector :: UnionOperation
|
||||||
|
self.PiePlatePlates = Tags.Otis1960_PiePlatePlates :: UnionOperation
|
||||||
|
|
||||||
self.BoxAttachment,
|
self.BoxAttachment,
|
||||||
self.BoxAlignPosition,
|
self.BoxAlignPosition,
|
||||||
@@ -134,6 +141,7 @@ function Otis1960.constructor(Tags)
|
|||||||
|
|
||||||
self.ElevatorDoors = Doors.constructor(self.ElevatorBox_1960, self.ElevatorDoor1, self.ElevatorDoor2, self.ElevatorDoorSensor)
|
self.ElevatorDoors = Doors.constructor(self.ElevatorBox_1960, self.ElevatorDoor1, self.ElevatorDoor2, self.ElevatorDoorSensor)
|
||||||
self.TractionRopes = TractionRopes.constructor(self.Ropes, self.ElevatorBox_1960, Leveling)
|
self.TractionRopes = TractionRopes.constructor(self.Ropes, self.ElevatorBox_1960, Leveling)
|
||||||
|
self.PiePlate = PieplateModule.constructor(self.PiePlateSelector, self.PiePlatePlates, self.ElevatorBox_1960)
|
||||||
|
|
||||||
--Buttons
|
--Buttons
|
||||||
local ButtonsConstructor = ButtonTags.constructor(Tags, Enums.Elevator.Otis1960)
|
local ButtonsConstructor = ButtonTags.constructor(Tags, Enums.Elevator.Otis1960)
|
||||||
@@ -150,6 +158,7 @@ end
|
|||||||
function Otis1960:__MoveFloors(Level)
|
function Otis1960:__MoveFloors(Level)
|
||||||
local ElevatorBoxCurrentPos = self.ElevatorBox_1960.Position
|
local ElevatorBoxCurrentPos = self.ElevatorBox_1960.Position
|
||||||
self.TractionRopes:Moving(Level, 26)
|
self.TractionRopes:Moving(Level, 26)
|
||||||
|
self.PiePlate:test()
|
||||||
|
|
||||||
self.BoxAlignPosition.Position = Vector3.new(ElevatorBoxCurrentPos.X, Level, ElevatorBoxCurrentPos.Z)
|
self.BoxAlignPosition.Position = Vector3.new(ElevatorBoxCurrentPos.X, Level, ElevatorBoxCurrentPos.Z)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ function TractionRopes:Moving(Level, Offset)
|
|||||||
if self.__RopeConnection then
|
if self.__RopeConnection then
|
||||||
self.__RopeConnection:Disconnect()
|
self.__RopeConnection:Disconnect()
|
||||||
end
|
end
|
||||||
self.__RopeConnection = RS.Heartbeat:Connect(function(_dt)
|
self.__RopeConnection = RS.Heartbeat:Connect(function(_dt) --Not safe for parallel
|
||||||
local Elevator = self.ElevatorBox
|
local Elevator = self.ElevatorBox
|
||||||
local ElevatorPosition = Elevator.Position
|
local ElevatorPosition = Elevator.Position
|
||||||
local l = self.BiggestRopeLength-ElevatorPosition.Y+Offset
|
local l = self.BiggestRopeLength-ElevatorPosition.Y+Offset
|
||||||
|
|||||||
Reference in New Issue
Block a user