The part named "Cargo" is supposed to be welded to a part called CargoHolder in the ship when it touches the ship's hull. It welds, but the cargo's CFrame is supposed to be set to the CFrame of CargoHolder. Instead it appears about 200 studs away from the ship and the CargoHolder part.
In other words, Cargo's CFrame needs to be set to CargoHolder's CFrame, and two studs above. What do I do?
ship = script.Parent.Parent hull = ship.Hull hull.Touched:connect(function(cargo) if cargo.Name == "Cargo" and cargo.ClassName == "Part" then local cargoWeld = Instance.new("Weld",ship.CargoHolder) cargoWeld.Name = "CargoWeld" cargoWeld.Part0 = ship.CargoHolder cargoWeld.Part1 = cargo cargoWeld.C0 = ship.CargoHolder.CFrame:inverse() cargoWeld.C1 = cargo.CFrame:inverse() cargo.CFrame = ship.CargoHolder.CFrame * CFrame.new(0,2,0) print("cargo attached to CargoHolder") end end)