#Armor not welding to Torso

1 messages · Page 1 of 1 (latest)

steep flint
#

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local equipEvent = ReplicatedStorage:WaitForChild("EquipArmorEvent")

equipEvent.OnServerEvent:Connect(function(player, armorName)
print("[ArmorEquipScript] Equip request received for", armorName)

local character = player.Character
if not character then return end

local armorFolder = ReplicatedStorage:FindFirstChild("Armor")
if not armorFolder then
    warn(" No Armor folder in ReplicatedStorage.")
    return
end

local armorTemplate = armorFolder:FindFirstChild(armorName)
if not armorTemplate then
    warn(" Armor", armorName, "not found in Armor folder.")
    return
end

local torso = character:FindFirstChild("UpperTorso") or character:FindFirstChild("Torso") or character:FindFirstChild("HumanoidRootPart")
if not torso or not torso:IsA("BasePart") then
    warn(" No suitable torso part found.")
    return
end
#

local armor = armorTemplate:Clone()
armor.Name = armorName .. "_Equipped"
armor.Parent = character

task.wait()

local root = armor:FindFirstChild("Handle") or armor.PrimaryPart
if not root or not root:IsA("BasePart") then
    warn(" No Handle or PrimaryPart in armor:", armor.Name)
    armor:Destroy()
    return
end

-- Move armor to match torso
if armor.PrimaryPart then
    armor:PivotTo(torso.CFrame)
else
    root.CFrame = torso.CFrame
end

-- Weld armor to torso
local weld = Instance.new("WeldConstraint")
weld.Part0 = torso
weld.Part1 = root
weld.Parent = root
print(" Weld created between", torso.Name, "and", root.Name)

-- Unanchor, make visible, and disable collision
for _, p in pairs(armor:GetDescendants()) do
    if p:IsA("BasePart") then
        p.Anchored = false
        p.CanCollide = false
        p.Transparency = 0
    end
end


root.BrickColor = BrickColor.new("Bright red")
root.Material = Enum.Material.Neon

print(" Armor", armor.Name, "equipped to", player.Name)

end)

#

sorry i had to send it in 2 parts, verry annoying

onyx gate
#

chatgpt?

steel torrent