-
What do you want to achieve?
Prevent the shaking while player present. -
What is the issue?
(Quality is not very good I can provide another video if needed)
- What solutions have you tried so far?
I have tried the following code:
function elevatorMove(level, callbutton, newPosition)
local PrimaryPlate = cage.Mainplate:FindFirstChild("PlatePrimary")
if PrimaryPlate.Position.Y ~= newPosition.Position.Y then
callbuttonDebouce(false)
-- Elevator En-route
callbutton.ProcessLight.BrickColor = BrickColor.new("Neon orange")
cage["Elevator Button"].Model["Call-Button"].ProcessLight.BrickColor = BrickColor.new("Neon orange")
script.isMoving.Value = true
local TweenService = game:GetService("TweenService")
local tweenTime = math.round(PrimaryPlate.Position.Y - newPosition.Position.Y) / 10
print(tweenTime)
if (PrimaryPlate.Position.Y - newPosition.Position.Y) < 0 then
tweenTime = tweenTime * -1
end
local tweenInfo = TweenInfo.new(tweenTime, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
local newYPos = PrimaryPlate.Position.Y - newPosition.Position.Y
TweenService:Create(PrimaryPlate, tweenInfo, {
CFrame = PrimaryPlate.CFrame * CFrame.new(0, newYPos * -1, 0)
}):Play()
wait(tweenTime)
script.isMoving.Value = false
openDoors(level, cage, callbutton)
else
callbuttonDebouce(false)
openDoors(level, cage, callbutton)
end
end
The above function is ran via a ProximityPrompt or with UI when appropriate and uses other functions to do other tasks. (I do not find them necessary to include)
This code allows me to move the elevator but from this solution raises the issue of shaking in movement. The elevator does contain three (3) floors.
All the parts are welded to the floor of the elevator using WeldConstraints generated by script.
Further Note: I did not build this elevator (@Dr3mD3x) nor intend to take credit for the building I am only tasked with scripting it.