It’s honestly hard to explain what I am trying to do, but the best way I can describe it is I want to have a smooth transition between sizes that adjust according to the IntValue. At the current moment, the change happens very suddenly, so there isn’t much smoothness. If there is a way to include the decimal points in the tween, I’d very much like to know. Here is the code:
game.ReplicatedStorage.ChangeSize.Event:Connect(function()
Type = math.random(1,3)
if Type == 1 then
TweenService:Create(SizeMultiplier, TweenInfo.new(30, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false), {Value = 7}):Play()
elseif Type == 2 then
TweenService:Create(SizeMultiplier, TweenInfo.new(30, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false), {Value = 1}):Play()
elseif Type == 3 then
TweenService:Create(SizeMultiplier, TweenInfo.new(30, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false), {Value = 3}):Play()
end
end)
while wait(0.01) do
Part = game.ServerStorage.Part:Clone()
SizeAmount = script.Parent.SizeValue
TweenService = game:GetService("TweenService")
Part.Size = Vector3.new(SizeAmount.Value * SizeMultiplier / 2, SizeAmount.Value * SizeMultiplier / 2, SizeAmount.Value * SizeMultiplier / 2)
Part.Parent = script.Parent.Parts
torpart.Position = script.Parent.Parts.Origin.Position
script.Parent.SizeAmount.Value = SizeAmount.Value / 3
script.Parent.Range.Value = SizeAmount.Value * 3
TweenService:Create(Part, TweenInfo.new(30, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false), {Position = Vector3.new(Part.Position.X, 170, Part.Position.Z)}):Play()
TweenService:Create(Part, TweenInfo.new(30, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false), {Size = Vector3.new(SizeAmount.Value * SizeMultiplier, SizeAmount.Value * SizeMultiplier, SizeAmount.Value * SizeMultiplier)}):Play()
sizechange = math.random(1,60)
if sizechange == 1 then
game.ReplicatedStorage.ChangeSize:Fire()
end
end