Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How To Apply Tweening To An Entire Model?

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()

1 comment

0

Set a PrimaryPart to your model and modify it using SetPrimaryCFrame and GetPrimaryCFrame: http://wiki.roblox.com/index.php?title=API:Class/Model/PrimaryPart

1 answer

✓ Accepted answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.