CHARLESTON, W.Va. — West Virginia lawmakers voted to end the state’s film production tax credit Friday following an audit that showed the credit produced little economic benefit for the state.

However, during nearly two hours of debate in the House, several delegates argued that the movies and television shows showcase the state, and the credits apply only when companies generate economic activity, employ people and spend money locally.

“We struggle attracting people to our state. We talk about it all the time,” said Delegate Shawn Fluharty, a Wheeling Democrat.

At the end of their films, tax credit recipients must say on screen that it was filmed in West Virginia. “That’s a great thing. That instills pride,” he said.

Critics said West Virginia lacks the infrastructure needed for film production and much larger credits offered by other states like Georgia. West Virginia’s filmmaker credits are capped at $5 million annually. They also noted that films made in the state like the Oscar-nominated documentary “Heroin(e)” were made without that tax help.

“While I very much support these type of productions, I can’t continue to support using these dollars when they could be used in a host of other manners in our budget for a higher benefit,” said Delegate Paul Espinosa, a Charles Town Republican.

An audit released in January concluded that over its 10 years, the program issued more than $15 million in credits to film production companies that had more than $49 million in direct and post-production expenses, meaning economic stimulus. But more than $21 million went to out-of-state residents and $3.7 million when to projects auditors deemed unqualified. After subtracting $15 million in lost taxes and the $3.1 million cost of the now shuttered state Film Office, the economic value was only $6.1 million over 10 years, they wrote.

The House voted 54-42 to eliminate issuing new credits Friday. The Senate had agreed 28-2 on Monday.

Gov. Jim Justice is expected to sign it. His administration has proposed spending $20 million on state tourism promotion and another $35 million to market West Virginia to businesses in the coming fiscal year while acknowledging problems with the film tax credit.

In other action during the Legislature’s second full week of its 2018 session, the House voted unanimously to transfer offenders from juvenile detention when they turn 18 to facilities for youthful offenders or to adult prisons in an effort to protect younger teens in state custody.

Earlier this week, the House voted to make it a crime to operate drones to view or capture images of people inside their homes. The House also passed a bill to require that the governor fill vacancies in elected state offices with someone from the same political party.

The Senate voted to establish a bill of rights for sex assault victims, including the right to have someone accompany them to medical exams and police questioning, have their rape kits processed for DNA and preserved, and to find out the results.

The Senate also voted to reauthorize and slightly reorganize the state’s Commission on Special Investigations, which probes state government corruption.

Senate committees advanced for a floor vote next week legislation to provide free community and technical college for West Virginians 18 and older in fields where state officials determine workers are needed.

The House Health and Human Resources Committee approved legislation to prohibit Medicaid abortions unless they’re needed to save a woman’s life. State data show 1,560 were done last year.