I’m trying to weld a part to a character’s HumanoidRootPart by creating both Part and WeldConstraint on the server but for some weird reason the player’s position stops replicating until there are not any parts welded to it.
Here is the video of the problem:
External MediaHere is the server code of the part and weld creation:
local function createHitbox(Player)
local PlayerCharacter = Player.Character
local HitboxCFrame = PlayerCharacter.HumanoidRootPart.CFrame*CFrame.new(0,0,-4)
local HitboxSize = Vector3.new(5,5,6)
local HitboxName = "NormalPunchHitbox"
local HitboxShape = Enum.PartType.Block
local HitboxLifetime = .3
local HitboxParent = PlayerCharacter
local HitboxWelded = true
local WeldPart0 = PlayerCharacter.HumanoidRootPart
local newHitbox = Instance.new("Part", HitboxParent)
newHitbox.CFrame = HitboxCFrame
newHitbox.Size = HitboxSize
newHitbox.Name = HitboxName
newHitbox.Shape = HitboxShape
newHitbox.CanCollide = false
newHitbox.Anchored = true
newHitbox.Massless = true
newHitbox.Transparency = .5
newHitbox.CastShadow = false
if HitboxWelded then
local HitboxWeld = Instance.new("WeldConstraint", newHitbox)
HitboxWeld.Part0 = WeldPart0
HitboxWeld.Part1 = newHitbox
newHitbox.Anchored = false
end
game.Debris:AddItem(newHitbox, HitboxLifetime)
end