(WARNING: Kind-of hard to keep track of code.)
Hello there. I am making a gore system that only works when a Motor6D is destroyed and since it has no collision when it’s destroyed, I made a hitbox script so it can collide with other objects.
local HeadHitbox = game.ServerStorage.HeadHitbox:Clone()
local LimbsHitbox = game.ServerStorage.LimbsHitbox:Clone()
local Head = script.Parent:WaitForChild("Head")
local Torso = script.Parent:WaitForChild("Torso")
local LArm = script.Parent:WaitForChild("Left Arm")
local RArm = script.Parent:WaitForChild("Right Arm")
local LLeg = script.Parent:WaitForChild("Left Leg")
local RLeg = script.Parent:WaitForChild("Right Leg")
-- Neck
-- Left Shoulder
-- Right Shoulder
-- Left Hip
-- Right Hip
Torso.DescendantRemoving:Connect(function(objectWhichWasRemoved)
if objectWhichWasRemoved.Name == "Left Shoulder" then
local LArmHitboxWeld = Instance.new("Weld")
LArmHitboxWeld.Name = "LArmHitboxWeld"
LimbsHitbox.Parent = game.Workspace
LArmHitboxWeld.Parent = LimbsHitbox
LArmHitboxWeld.Part0 = LArm
LArmHitboxWeld.Part1 = LimbsHitbox
LArmHitboxWeld.C0 = LArm.CFrame
LArmHitboxWeld.C1 = LimbsHitbox.CFrame
end
end)
When the C0 configuration CFrames itself to the Left Arm of the character, it is offset by a good bit.