i have been trying to make so when a part touches another part, it will run a if statement if the parts name is correct, and clone the part with the right name. But I don't know how to place the copied part, i have tried
Part:clone().CFrame = CFrame.new(111.2, 16.1, 86.9)
and
Part:clone().CFrame = Vector3.new(111.2, 16.1, 86.9)
but the part always gets placed on the exact same place as the part it gets copied from, anyone know how to fix?
You're using a Vector3 datatype to set the CFrame
property. The CFrame property takes a CFrame datatype!
Remember to parent the cloned part as well.
The best way to solve your problem would be assigning a variable
to the cloned part, then you can edit it properties from the variable.
Set the CFrame property to a CFrame value
Parent the cloned part
local p = Part:Clone() p.CFrame = CFrame.new(111.2,16.1,86.9) p.Parent = workspace