When i tweening part with this script its not moving:
function module.infectPartDownUp(part,color)
local infectPart = Instance.new("Part",part)
infectPart.Name = "InfectedPart"
infectPart.BrickColor = color
infectPart.Material = Enum.Material.Plastic
infectPart.CanCollide = false
local weld = Instance.new("WeldConstraint",infectPart)
local ySize = part.Size.Y
infectPart.Size = Vector3.new(part.Size.X,0,part.Size.Z)
infectPart.CFrame = part.CFrame-(part.CFrame.UpVector*part.Size.Y/2)
weld.Part0 = infectPart
weld.Part1 = part
TweenService:Create(infectPart,TweenInfo.new(1,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),
{CFrame = part.CFrame+(part.CFrame.UpVector*part.Size.Y/2),Size = part.Size}):Play()
end
part script:
local db = false
local module = require(game.ServerScriptService.InfectingModuleScript)
script.Parent.ClickDetector.MouseClick:Connect(function()
if db == false then
db = true
module.infectPartDownUp(script.Parent,BrickColor.White())
end
end)
Whats wrong with my code?