So I am working on an elevator using Tweening. It works fine with this script however I want to use as few scripts as possible to move the entire elevator. I could just put this in every part in the elevator but how can I apply one script to all the parts in the elevator model?
platform = script.Parent local TweenService = game:GetService("TweenService") local TweenInfo = TweenInfo.new(5,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0) local platformMove = {CFrame = platform.CFrame + platform.CFrame.upVector * 11} local openFunction = TweenService:Create(platform,TweenInfo,platformMove) openFunction:Play()
You could use a
for i, v in pairs () do
loop, but bear in mind that each objects CFrame can be affected in different ways when using this.
You can find a link about this type of loop here.