This script does not work , can anyone see if there is a problem?
local part = script.Parent local tweenservice = game:GetService("TweenService") local tweenInfo = TweenInfo.new(2,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0) local Up = {CFrame = part.CFrame + part.CFrame.Position (0,1.296,0) } local Down = {CFrame = part.CFrame + part.CFrame.Position (0,-1.296,0) } GoDown = tweenservice:Create(part,tweenInfo,Up) GoUp = tweenservice:Create(part,tweenInfo,Down) while true do wait(3) GoDown:Play() wait(3) GoUp:Play() wait() end
To move parts correctly using CFrames, please use Vector3.new.
local part = script.Parent local tweenservice = game:GetService("TweenService") local tweenInfo = TweenInfo.new(2,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0) local Up = {CFrame = part.CFrame + Vector3.new(0,1.296,0) } local Down = {CFrame = part.CFrame + Vector3.new(0,-1.296,0) } GoDown = tweenservice:Create(part,tweenInfo,Up) GoUp = tweenservice:Create(part,tweenInfo,Down) while true do wait(3) GoDown:Play() wait(3) GoUp:Play() wait() end
Down tween will actually move elevator below initial position. If you just want to go back to the starting position use:
local Down = {CFrame = part.CFrame }
Have a nice scripting session!