I'm making a tycoon that when you buy an item the parts float into place. This is a script that gets cloned into each brick. But I cant figure out what's wrong
function Effect(Part)
local OldPos = Part.CFrame
local Num1 = math.random(2,5)
local Num2 = math.random(2,5)
local Num3 = math.random(2,5)
local Rot1 = math.random(1,180)
local Rot2 = math.random(1,180)
local Rot3 = math.random(1,180)
local Pos = OldPos + Vector3.new(Num1,Num2,Num3)
local FullPos = Pos * CFrame.Angles(math.rad(Rot1),math.rad(Rot2),math.rad(Rot3))
Part.CFrame = FullPos
for i = 1,100 do
wait(1)
local NewPos = FullPos - Vector3.new(FullPos.X-Num1/100,FullPos.Y-Num2/100,FullPos.Z-Num3/100)
Part.CFrame = NewPos
end
end
Effect(script.Parent)
Thankyou
