-- Start the tween

local currhealth = nil

hum.HealthChanged:Connect(function(health)
	script.Parent.Text = tostring( math.floor((health/hum.MaxHealth) * 100)).."%"
	--	print(health/hum.MaxHealth)
	currhealth = math.floor((health/hum.MaxHealth) * 100)
	if currhealth >=75 then
		colorcahnge(Color3.new(0, 1, 0.498039))
	elseif currhealth < 75 and currhealth >= 25 then
		colorcahnge(Color3.new(1, 1, 0))

	else
		colorcahnge(Color3.new(1, 0, 0))

	end
end)

hum.Died:Connect(function()
	model:PivotTo(cframe)
	model.Parent = workspace
	
	task.wait(1)
	hum.Parent:Destroy()
end)
