diff --git a/src/server/main/Elevators/Otis1960/Doors.lua b/src/server/main/Elevators/Otis1960/Doors.lua index 7834b3a..6f1455f 100644 --- a/src/server/main/Elevators/Otis1960/Doors.lua +++ b/src/server/main/Elevators/Otis1960/Doors.lua @@ -46,13 +46,13 @@ export type DoorConstructor = ClassConstructor local Doors = {} :: Impl_Constructor Doors.__index = Doors -Doors.Closed = true -Doors.Sensors = true -Doors.Door1Stopped_X = Vector3.xAxis*2.9 -Doors.Door2Stopped_X = Vector3.xAxis*5.8 -Doors.ElevatorDoorTime = 5 +Doors.Closed = true +Doors.Sensors = true +Doors.Door1Stopped_X = Vector3.xAxis*2.9 +Doors.Door2Stopped_X = Vector3.xAxis*5.8 +Doors.ElevatorDoorTime = 5 Doors.ElevatorDoorStyle = Enum.EasingStyle.Quad -Doors.__DontLeakMemory = nil +Doors.__DontLeakMemory = nil function Doors.constructor(ElevatorBox, ElevatorDoor1, ElevatorDoor2, ElevatorDoorSensor) local DoorTween1 = Tween.constructor(nil, ElevatorDoor1) @@ -168,7 +168,8 @@ raycastParams.FilterType = Enum.RaycastFilterType.Exclude local RayIgnoring = {} local workspace_items = workspace:GetChildren() for n: number = 1, #workspace_items do - if workspace_items[n]:IsA("Folder") then + local Inst = workspace_items[n] + if Inst:IsA("Folder") or Inst:IsA("BasePart") then table.insert(RayIgnoring, workspace_items[n]) end end @@ -215,6 +216,7 @@ function Doors:Opening(opening) local Door1Tween, Door2Tween = DoorsAnimation(self, opening) Door2Tween.Completed:Wait() + if Doors.__DontLeakMemory then Doors.__DontLeakMemory:Disconnect() end diff --git a/src/server/main/Elevators/Otis1960/init.lua b/src/server/main/Elevators/Otis1960/init.lua index 25d1f7f..8fce975 100644 --- a/src/server/main/Elevators/Otis1960/init.lua +++ b/src/server/main/Elevators/Otis1960/init.lua @@ -201,7 +201,7 @@ function Otis1960:__MoveFloors(GoalLevelVEC, RequestedLevel, GoingUp) end --Otis1960_ShaftGovernor - self.__MovingConnection = RS.Stepped:Connect(function(_delta, _dt) --Not safe for parallel + self.__MovingConnection = RS.Heartbeat:Connect(function(_dt) --Not safe for parallel RotationDelta+=1 Otis1960.__Moving = true @@ -213,7 +213,7 @@ function Otis1960:__MoveFloors(GoalLevelVEC, RequestedLevel, GoingUp) --Kill the connection if GoingUp then - if ElevatorPosition.Y>=self.BoxAlignPosition.Position.Y-4 then + if ElevatorPosition.Y>=self.BoxAlignPosition.Position.Y-1 then self.BoxAlignPosition.MaxVelocity = .35 self.LanternsConstructor:Toggle(true, RequestedLevel) end @@ -228,7 +228,7 @@ function Otis1960:__MoveFloors(GoalLevelVEC, RequestedLevel, GoingUp) self.LanternsConstructor:Reset() end else - if ElevatorPosition.Y<=self.BoxAlignPosition.Position.Y+4 then + if ElevatorPosition.Y<=self.BoxAlignPosition.Position.Y+1 then self.BoxAlignPosition.MaxVelocity = .35 self.LanternsConstructor:Toggle(true, RequestedLevel) end diff --git a/src/server/main/PlayerAdded/Character/init.lua b/src/server/main/PlayerAdded/Character/init.lua index 89e788a..d9e5284 100644 --- a/src/server/main/PlayerAdded/Character/init.lua +++ b/src/server/main/PlayerAdded/Character/init.lua @@ -89,7 +89,7 @@ function Character.constructor(CharacterModel) self.Spine:Move(CameraPosition, IsFirstPerson) else --reset - print("TODO reached -", script.Name..".lua") + warn("TODO reached -", script.Name..".lua") end else Messenger:Kick(`"{Messenger.Name}", {Messenger.UserId} r="{self.Spine.Remote.Name}", 1="{tostring(CameraPosition)}", 2="{tostring(IsFirstPerson)}"`) diff --git a/src/shared/Algebra.lua b/src/shared/Algebra.lua index 2146c0a..334f68c 100644 --- a/src/shared/Algebra.lua +++ b/src/shared/Algebra.lua @@ -27,6 +27,7 @@ export type Math = { InOutBack: EaseFunction, OutBounce: EaseFunction, InQuad: EaseFunction, + IsOdd: (n: number) -> boolean, IsEven: (n: number) -> boolean, RotationMatrix: (X: number, Y: number, Z: number) -> RotationMatrix, Scalar: (X1: number, Y1: number, X2: number, Y2: number) -> Scalar, @@ -36,10 +37,14 @@ export type Math = { local Math = {} :: Math -function Math.IsEven(n) +function Math.IsOdd(n) return bit32.btest(bit32.band(n, 1)) end +function Math.IsEven(n) + return not Math.IsOdd(n) +end + function Math.maxmin(min, n, max) return math.max(min, math.min(n, max)) end