I'm getting this error when I try and change the part properties through the function - line 20. Any help would be appreciated.
function createCharacterAnchors() torso = character:WaitForChild("Torso") if torso ~= nil then print("found") local function createNewAnchor() print("started") local part = Instance.new("Part") part.Transparency = 1 part.CanCollide = false part.FormFactor = Enum.FormFactor.Custom part.Size = 0.2 * Vector3.new(1, 1, 1) part.TopSurface = Enum.SurfaceType.Smooth part.BottomSurface = Enum.SurfaceType.Smooth part.Parent = character end end end local torsoCore = createCharacterAnchors() torsoCore.Name = "TorsoCore" local torsoCoreMotor = createNewMotor() torsoCoreMotor.Name = "TorsoCore" torsoCoreMotor.C0 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, math.pi, 0) torsoCoreMotor.Part0 = character.Torso torsoCoreMotor.Part1 = torsoCore
It does not look like createCharacterAnchors() returns anything so you'd have to add a return to the function