Possible for me to make this tween?

So Its almost impossible to scale a r6 character but ive found a script that can do that. But the thing is I dont know how to tween it? How can I do it? this is the script:

		local Motors = {}
		table.insert(Motors, Player.Character.HumanoidRootPart.RootJoint)
		for i,Motor in pairs(Player.Character.Torso:GetChildren()) do
			if Motor:IsA("Motor6D") == false then continue end
			table.insert(Motors, Motor)
		end
		for i,v in pairs(Motors) do
			v.C0 = CFrame.new((v.C0.Position * Percent)) * (v.C0 - v.C0.Position)
			v.C1 = CFrame.new((v.C1.Position * Percent)) * (v.C1 - v.C1.Position)
		end
		
		
		for i,Part in pairs(Player.Character:GetChildren()) do
			if Part:IsA("BasePart") == false then continue end
			Part.Size = Part.Size * Percent
		end
		
		
		for i,Accessory in pairs(Player.Character:GetChildren()) do
			if Accessory:IsA("Accessory") == false then continue end
			
			Accessory.Handle.AccessoryWeld.C0 = CFrame.new((Accessory.Handle.AccessoryWeld.C0.Position * Percent)) * (Accessory.Handle.AccessoryWeld.C0 - Accessory.Handle.AccessoryWeld.C0.Position)
			Accessory.Handle.AccessoryWeld.C1 = CFrame.new((Accessory.Handle.AccessoryWeld.C1.Position * Percent)) * (Accessory.Handle.AccessoryWeld.C1 - Accessory.Handle.AccessoryWeld.C1.Position)
			Accessory.Handle:FindFirstChildOfClass("SpecialMesh").Scale *= Percent	
		end

For the CFrame you can lerp them . Like :

local Target1 =  CFrame.new((v.C0.Position * Percent)) * (v.C0 - v.C0.Position)
local Target2 =  CFrame.new((v.C1.Position * Percent)) * (v.C1 - v.C1.Position)

for i = 1 , 10 do
 local Delta = RunService.Heartbeat:Wait()
 v.C0 = v.C0:lerp(Target1,i/10)
 v.C1 = v.C1:lerp(Target2,i/10)
end

This is just a pseudo code , you can change it to the way you want

For size you can just tween it

TweenService:Create(Part,TweenInfo.new(Time),{Size=Part.Size *Percent}):Play()

would i have to user a lerp to make the character size change smoothly?

The Lerp is to change to smoothly change the CFrame , If its not needed you could just ignore it and just do the Size. Also i think that Lerping of CFrame and tweening of Size should be synced for perfect result.

I never used a lerp so how would I do it for the whole character?

well if you wanna use Lerp for Size too , just do

local Target = Part.Size
for i = 1,10 do
 local Delta = RunService.Heartbeat:Wait()
 Part.Size = Part.Size:lerp(Target ,i/10)
end

No i mean like for the motor6ds they change the position but for the limbs they change the size

Yes i showed you how to Lerp the Motor6D’s CFrame too.

So I would Have to mix the 2 scripts you made?

You can either follow the method of tweening and tween both CFrame and Size or use Lerp and lerp both CFrame and Size , its all upto you now.

1 Like