I am making custom hitboxes, it just dynamically duplicates the body parts.
It does print the right results, but it doesn’t seem to be welded (aka. falling down)
Code (server script):
local character = script.Parent.Parent
local hitboxFolder = script.Parent.Parent.Hitbox or character:WaitForChild("Hitbox")
repeat task.wait() until character:IsA("Model")
for i,v in pairs(character:GetChildren()) do
if v:IsA("BasePart") and v.Name ~= "HumanoidRootPart" then
print(v.Name, "found: "..v.ClassName)
task.wait()
local hitBox = Instance.new("Part")
hitBox.Parent = hitboxFolder
hitBox.Name = v.Name.."_hitBox"
hitBox.CanCollide = false
hitBox.Massless = true
hitBox.Size = v.Size
hitBox.CFrame = v.CFrame
hitBox.Material = Enum.Material.Neon
hitBox.BrickColor = BrickColor.new("Bright red")
print(hitBox.Name, "created: "..hitBox.Name)
task.wait()
local weld = Instance.new("Weld")
weld.Name = v.Name.."_weld"
weld.Parent = hitBox
weld.Part0 = v
weld.Part1 = hitBox
print(weld.Name, "welded: "..weld.Part0.Name, "-", weld.Part1.Name)
end
end
Explorer:
Results (it only does it for the head):
ONE LAST NOTE:
theres a script in ServerScriptService that does Humanoid:ReplaceBodyPartR15()