Hi I am currently remaking the Kitteh6660 ArmorModule script for it to work for R15, But everytime it change armor the character dies but get the bonus once respawned. But he doesn't wear the armor.(I removed some bodypart scripts because it is repetitive)
local ArmorModule = {} --This script exists to let you add armor to mobs and also, to auto re-equip armor on respawn. function ArmorModule.GetLevel(armor) if Game.ReplicatedStorage.ARMORS:FindFirstChild(armor) ~= nil then return Game.ReplicatedStorage.ARMORS:FindFirstChild(armor).Level.Value else return 0 --If it's not found, returns 0. end end function ArmorModule.GetDefense(armor) if Game.ReplicatedStorage.ARMORS:FindFirstChild(armor) ~= nil then if Game.Workspace.GAME_PROPERTIES.DefenseMode.Value == 1 or Game.Workspace.GAME_PROPERTIES.DefenseMode.Value == 2 then return Game.ReplicatedStorage.ARMORS:FindFirstChild(armor).Defense.Value elseif Game.Workspace.GAME_PROPERTIES.DefenseMode.Value == 3 then return Game.ReplicatedStorage.ARMORS:FindFirstChild(armor).HPBoost.Value else return 0 --If it's not found, returns 0. end else return 0 --If it's not found, returns 0. end end function ArmorModule.RemoveArmor(character) local humanoid = character:FindFirstChild("Humanoid") or character:FindFirstChild("Human") --Remove old armour. if humanoid ~= nil then if character:FindFirstChild("UpperLeg1") ~= nil then character:FindFirstChild("UpperLeg1"):Remove() end if character:FindFirstChild("UpperLeg2") ~= nil then character:FindFirstChild("UpperLeg2"):Remove() end if character:FindFirstChild("UpperArm1") ~= nil then character:FindFirstChild("UpperArm1"):Remove() end if character:FindFirstChild("UpperArm2") ~= nil then character:FindFirstChild("UpperArm2"):Remove() end if character:FindFirstChild("LowerTorso") ~= nil then character:FindFirstChild("LowerTorso"):Remove() end if character:FindFirstChild("LowerArm1") ~= nil then character:FindFirstChild("LowerArm1"):Remove() end if character:FindFirstChild("LowerArm2") ~= nil then character:FindFirstChild("LowerArm2"):Remove() end if character:FindFirstChild("Hand1") ~= nil then character:FindFirstChild("Hand1"):Remove() end if character:FindFirstChild("Hand2") ~= nil then character:FindFirstChild("Hand2"):Remove() end if character:FindFirstChild("Foot1") ~= nil then character:FindFirstChild("Foot1"):Remove() end if character:FindFirstChild("Foot2") ~= nil then character:FindFirstChild("Foot2"):Remove() end if character:FindFirstChild("LowerLeg1") ~= nil then character:FindFirstChild("LowerLeg1"):Remove() end if character:FindFirstChild("LowerLeg2") ~= nil then character:FindFirstChild("LowerLeg2"):Remove() end if character:FindFirstChild("UpperTorso") ~= nil then character:FindFirstChild("UpperTorso"):Remove() end else return false --Exits the function if it's nil. Prevents the function from breaking. end end function ArmorModule.EquipArmor(character, armor) local humanoid = character:FindFirstChild("Humanoid") or character:FindFirstChild("Human") if character ~= nil then --Remove old armour. if humanoid ~= nil then if character:FindFirstChild("UpperLeg1") ~= nil then character:FindFirstChild("UpperLeg1"):Remove() end if character:FindFirstChild("UpperLeg2") ~= nil then character:FindFirstChild("UpperLeg2"):Remove() end if character:FindFirstChild("UpperArm1") ~= nil then character:FindFirstChild("UpperArm1"):Remove() end if character:FindFirstChild("UpperArm2") ~= nil then character:FindFirstChild("UpperArm2"):Remove() end if character:FindFirstChild("LowerTorso") ~= nil then character:FindFirstChild("LowerTorso"):Remove() end if character:FindFirstChild("LowerArm1") ~= nil then character:FindFirstChild("LowerArm1"):Remove() end if character:FindFirstChild("LowerArm2") ~= nil then character:FindFirstChild("LowerArm2"):Remove() end if character:FindFirstChild("Hand1") ~= nil then character:FindFirstChild("Hand1"):Remove() end if character:FindFirstChild("Hand2") ~= nil then character:FindFirstChild("Hand2"):Remove() end if character:FindFirstChild("Foot1") ~= nil then character:FindFirstChild("Foot1"):Remove() end if character:FindFirstChild("Foot2") ~= nil then character:FindFirstChild("Foot2"):Remove() end if character:FindFirstChild("LowerLeg1") ~= nil then character:FindFirstChild("LowerLeg1"):Remove() end if character:FindFirstChild("LowerLeg2") ~= nil then character:FindFirstChild("LowerLeg2"):Remove() end if character:FindFirstChild("UpperTorso") ~= nil then character:FindFirstChild("UpperTorso"):Remove() end end else return false --Exits the function if it's nil. Prevents the function from breaking. end --Arms if humanoid ~= nil and character:FindFirstChild("Hand1") == nil then local g = Game.ReplicatedStorage.ARMORS:FindFirstChild(armor).Hand1:Clone() g.Parent = character local C = g:GetChildren() for i=1, #C do if C[i].ClassName == "MeshPart" then if C[i].Name == "Middle" then C[i].Transparency = 1 end local W = Instance.new("Weld") W.Part0 = g.Middle W.Part1 = C[i] local CJ = CFrame.new(g.Middle.Position) local C0 = g.Middle.CFrame:inverse()*CJ local C1 = C[i].CFrame:inverse()*CJ W.C0 = C0 W.C1 = C1 W.Parent = g.Middle end local Y = Instance.new("Weld") Y.Part0 = character["LeftHand"] Y.Part1 = g.Middle Y.C0 = CFrame.new(0, 0, 0) Y.Parent = Y.Part0 end local h = g:GetChildren() for i = 1, # h do h[i].Anchored = false h[i].CanCollide = false end end if humanoid ~= nil and character:FindFirstChild("Foot2") == nil then local g = Game.ReplicatedStorage.ARMORS:FindFirstChild(armor).Foot2:Clone() g.Parent = character local C = g:GetChildren() for i=1, #C do if C[i].ClassName == "Part" then if C[i].Name == "Middle" then C[i].Transparency = 1 end local W = Instance.new("Weld") W.Part0 = g.Middle W.Part1 = C[i] local CJ = CFrame.new(g.Middle.Position) local C0 = g.Middle.CFrame:inverse()*CJ local C1 = C[i].CFrame:inverse()*CJ W.C0 = C0 W.C1 = C1 W.Parent = g.Middle end local Y = Instance.new("Weld") Y.Part0 = character["RightFoot"] Y.Part1 = g.Middle Y.C0 = CFrame.new(0, 0, 0) Y.Parent = Y.Part0 end local h = g:GetChildren() for i = 1, # h do h[i].Anchored = false h[i].CanCollide = false end end --Torso if humanoid ~= nil and character:FindFirstChild("UpperTorso") == nil then local g = Game.ReplicatedStorage.ARMORS:FindFirstChild(armor).UpperTorso:Clone() g.Parent = character local C = g:GetChildren() for i=1, #C do if C[i].ClassName == "Part" then if C[i].Name == "Middle" then C[i].Transparency = 1 end local W = Instance.new("Weld") W.Part0 = g.Middle W.Part1 = C[i] local CJ = CFrame.new(g.Middle.Position) local C0 = g.Middle.CFrame:inverse()*CJ local C1 = C[i].CFrame:inverse()*CJ W.C0 = C0 W.C1 = C1 W.Parent = g.Middle end local Y = Instance.new("Weld") Y.Part0 = character["UpperTorso"] Y.Part1 = g.Middle Y.C0 = CFrame.new(0, 0, 0) Y.Parent = Y.Part0 end local h = g:GetChildren() for i = 1, # h do h[i].Anchored = false h[i].CanCollide = false end end if humanoid ~= nil and character:FindFirstChild("LowerTorso") == nil then local g = Game.ReplicatedStorage.ARMORS:FindFirstChild(armor).LowerTorso:Clone() g.Parent = character local C = g:GetChildren() for i=1, #C do if C[i].ClassName == "Part" then if C[i].Name == "Middle" then C[i].Transparency = 1 end local W = Instance.new("Weld") W.Part0 = g.Middle W.Part1 = C[i] local CJ = CFrame.new(g.Middle.Position) local C0 = g.Middle.CFrame:inverse()*CJ local C1 = C[i].CFrame:inverse()*CJ W.C0 = C0 W.C1 = C1 W.Parent = g.Middle end local Y = Instance.new("Weld") Y.Part0 = character["LowerTorso"] Y.Part1 = g.Middle Y.C0 = CFrame.new(0, 0, 0) Y.Parent = Y.Part0 end local h = g:GetChildren() for i = 1, # h do h[i].Anchored = false h[i].CanCollide = false end end end return ArmorModule