if neighbour ~= nil then
if direction == 1 then
newChunk:WaitForChild("chunkModel0"):PivotTo(newChunk:WaitForChild("chunkModel0").PrimaryPart.CFrame()*CFrame.Angles(0,math.rad(neighbour.Parent.Parent.node.Orientation.Y),0) * CFrame.Angles(0, math.rad(0),0))
elseif direction == 2 then
newChunk:WaitForChild("chunkModel0"):PivotTo(newChunk:WaitForChild("chunkModel0").PrimaryPart.CFrame()*CFrame.Angles(0,math.rad(neighbour.Parent.Parent.node.Orientation.Y),0) * CFrame.Angles(0, math.rad(90),0))
elseif direction == 3 then
newChunk:WaitForChild("chunkModel0"):PivotTo(newChunk:WaitForChild("chunkModel0").PrimaryPart.CFrame()*CFrame.Angles(0,math.rad(neighbour.Parent.Parent.node.Orientation.Y),0) * CFrame.Angles(0, math.rad(180),0))
elseif direction == 4 then
newChunk:WaitForChild("chunkModel0"):PivotTo(newChunk:WaitForChild("chunkModel0").PrimaryPart.CFrame()*CFrame.Angles(0,math.rad(neighbour.Parent.Parent.node.Orientation.Y),0) * CFrame.Angles(0, math.rad(270),0))
end
end
hello this is a piece of code for my city generation system, but somehow its still giving a error, could someone tell me how to do this properly?