t attachment
local motor6D = Instance.new("Motor6D")
motor6D.Part0 = clonedAccessory.Handle
motor6D.Part1 = targetAttachment.Parent
motor6D.C0 = handleAttachment.CFrame
motor6D.C1 = targetAttachment.CFrame
motor6D.Parent = clonedAccessory.Handle
end
-- Example usage
local npc = workspace:FindFirstChild("YourNPCName") -- Replace with your NPC's name/path
addAccessoryToNPC(npc, "YourAccessoryName") -- Replace with the name of the accessory in ReplicatedStorage
This updated function looks for an attachment inside the accessory's handle and tries to find a matching attachment by name inside the NPC model. If a matching attachment is found, it creates a `Motor6D` instead of a `Weld` to connect the accessory to the NPC. This is because `Motor6D` is better suited for attaching things according to Roblox's accessory system, especially when considering animations and movements.
Remember, the position and orientation (`C0` and `C1` properties) of the accessory relative to the NPC might need fine-tuning based on the accessory and the NPC model's specifics. Experiment with these values as necessary to get the positioning right.
Try Voicify! It's the best way to make AI vocal covers of your favorite songs.
Check out this demo! Squidward singing Gorilla Warfare by $uicideboy$
Expert Mode
GPT-4 is in expert mode. Current expert: Computer Expert

