------Respawn------

local marine = script.Parent.Parent.Parent
local myHead = marine.Head
local myHuman = marine.Humanoid

local oldHealth = myHuman.Health
local healthAfterDamage = myHuman.Health

local clone = marine:Clone()

local modules = script.Parent.Parent.Modules
local core = require(modules.CoreModule)
local actions = require(modules.ActionsModule)
local status = require(modules.Status)

local combatModule = require(modules:WaitForChild("CombatModule"))

local ArmorDurability = combatModule.ArmorDurability
local MaxArmorDurability = ArmorDurability
local ShowArmorBar = combatModule.ShowArmorBar

local DeathAnimation = myHuman:LoadAnimation(marine:WaitForChild("DeathAnimation"))

local ArmorGUI = myHead:WaitForChild("ArmorBar")
local ArmorFrame = ArmorGUI:WaitForChild("MainFrame")
local ArmorBar = ArmorFrame:WaitForChild("Bar")
local ArmorFill = ArmorBar:WaitForChild("Fill")

local HealthGUI = myHead:WaitForChild("HealthBar")
local HealthFrame = HealthGUI:WaitForChild("MainFrame")
local HealthBar = HealthFrame:WaitForChild("Bar")
local HealthFill = HealthBar:WaitForChild("Fill")
local HealthShading = HealthFill:WaitForChild("Shading")

local NameTag = myHead:WaitForChild("NameTag")
local NameFrame = NameTag:WaitForChild("MainFrame")
local NameText = NameFrame:WaitForChild("TextLabel")

local OverrideDefaultGUI = true -- turn this to false if u want to use the default roblox health gui and name gui

NameText.Text = marine.Name

if ShowArmorBar == true then
	ArmorGUI.Enabled = true
else
	ArmorGUI.Enabled = false
end

if OverrideDefaultGUI == true then
	HealthGUI.Enabled = true
	NameTag.Enabled = true
else
	HealthGUI.Enabled = false
	NameTag.Enabled = false
end

local TweenService = game:GetService("TweenService")
