This is the humanoid handler that I believe could have been the cause. I found a sound play file in the onDied function but it references a sound file that I can’t find anywhere else in the model. I’ve deleted it in one of the soldiers but I’ve been unable to test if it was the cause.
myHuman.Died:Connect(function()
diedSound:Play()
actions.yieldM4()
actions.updateFace("Dead")
if marine.Settings.PlayDeathAnimation.Value == true then
myHuman.BreakJointsOnDeath = false
marine.HumanoidRootPart.Anchored = true
DeathAnimation:Play()
DeathAnimation.Stopped:Wait()
end
for i,v in ipairs(marine:GetDescendants()) do
if v:IsA("BallSocketConstraint") then
v.Enabled = true
elseif v:IsA("BasePart") and v.Name ~= "myHumanoidRootPart" then
v.CanCollide = false
elseif v:IsA("Motor6D") then
v:Destroy()
end
end
if marine.Settings.Respawn.Value then
wait(marine.Settings.RespawnDelay.Value)
clone.Parent = marine.Parent
ArmorDurability = MaxArmorDurability
end
for i,v in ipairs(marine:GetDescendants()) do
if v:IsA("BasePart") or v:IsA("Decal") then
game:GetService("TweenService"):Create(v,TweenInfo.new(0.2),{Transparency = 1}):Play()
end
end
rotAttach1:Destroy()
wait(0.2)
marine:Destroy()
end)
I don’t actually know if I’m meant to upload this amount of code, especially since it’s from the toolbox but this is most of the code
local soundSpeeds = {0.9,0.95,1,1.05,1.1}
myHuman.HealthChanged:Connect(function(health)
if ArmorDurability > 0 then
local damageTaken = oldHealth - health
if (ArmorDurability - damageTaken) <= 0 then
ArmorDurability = 0
marine.Torso.ArmorBroken:Play()
local Info = TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)
local Properties1 = {BackgroundTransparency = 1}
local Properties2 = {ImageTransparency = 1}
ArmorFill.Size = UDim2.new(0, 0, 1, 0)
for i,v in pairs(ArmorGUI:GetDescendants()) do
if v:IsA("Frame") then
local Tween = TweenService:Create(v,Info,Properties1)
Tween:Play()
elseif v:IsA("ImageLabel") then
local Tween = TweenService:Create(v,Info,Properties2)
Tween:Play()
end
end
else
ArmorDurability -= damageTaken
ArmorFill.Size = UDim2.new((ArmorDurability / MaxArmorDurability) * 1, 0, 1, 0)
myHuman.Health = oldHealth
end
end
if health < oldHealth and hurtSound.IsPlaying == false then
status:set("tookDamage",true)
if math.random(3) == 1 then
hurtSound.PlaybackSpeed = soundSpeeds[math.random(#soundSpeeds)]
hurtSound:Play()
end
core.spawn(function()
actions.updateFace("Hurt")
wait(1)
if myHead:FindFirstChild("faceHurt") then
actions.updateFace(status:get("mood"),true)
end
end)
end
oldHealth = myHuman.Health
if myHuman.Health <= 0 then
local Info = TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)
local Properties1 = {BackgroundTransparency = 1}
local Properties2 = {ImageTransparency = 1}
HealthFill.Size = UDim2.new(0, 0, 1, 0)
for i,v in pairs(HealthGUI:GetDescendants()) do
if v:IsA("Frame") then
local Tween = TweenService:Create(v,Info,Properties1)
Tween:Play()
elseif v:IsA("ImageLabel") then
local Tween = TweenService:Create(v,Info,Properties2)
Tween:Play()
end
end
else
HealthFill.Size = UDim2.new((myHuman.Health / myHuman.MaxHealth) * 1, 0, 1, 0)
if myHuman.Health < 45 then
for i,v in pairs(HealthFrame:GetChildren()) do
if v.Name == "Borders" then
v.BackgroundColor3 = Color3.fromRGB(189, 63, 63)
end
end
HealthBar.BorderColor3 = Color3.fromRGB(189, 63, 63)
HealthFill.BackgroundColor3 = Color3.fromRGB(189, 63, 63)
HealthShading.BackgroundColor3 = Color3.fromRGB(194, 87, 87)
HealthFrame.ImageLabel.ImageColor3 = Color3.fromRGB(189, 63, 63)
else
for i,v in pairs(HealthFrame:GetChildren()) do
if v.Name == "Borders" then
v.BackgroundColor3 = Color3.fromRGB(0, 189, 0)
end
end
HealthBar.BorderColor3 = Color3.fromRGB(0, 189, 0)
HealthFill.BackgroundColor3 = Color3.fromRGB(0, 189, 0)
HealthShading.BackgroundColor3 = Color3.fromRGB(115, 189, 102)
HealthFrame.ImageLabel.ImageColor3 = Color3.fromRGB(0, 189, 0)
end
end
end)