SAN FRANCISCO — When LLuka Doncic started cooking in the first quarter, the Lakers followed his lead in opening a 25-point lead in the second quarter over the Golden State Warriors Friday night.

But then the Lakers started getting cooked.

Cooked by going down by 17 points in the fourth quarter. Cooked by turning the ball over too many times. Cooked by an offense nowhere to be found in the fourth quarter. Cooked in the first NBA Cup game for both teams.

When the game was over, the Lakers had been feasted upon by the Warriors, falling 112-95 at Chase Center.

“I thought as the game progressed the problem-solving and connectivity, we just didn’t have it tonight,” Lakers coach JJ Redick said. “And they got hot.”

Doncic had 37 points, but he shot only 12 for 27 from the field and six for 16 from three-point range. Austin Reaves had 21 points on nine-for-19 shooting, but only one for six from three-point range.

For the Warriors, Stephen Curry had 31 points, shooting 11 for 23 from the field and eight for 14 from three-point range,

The Lakers scored only 15 points in the fourth quarter and gave up 27.

It took the Lakers four minutes and one second to finally score in the fourth and that came after Walker Kessler made just one free throw with 7:54 left in the game, leaving the Lakers down 96-81.

“Everybody gotta be better than this,” Doncic said. “You’re up 25, 23, first (half). Then I gotta be better and we just gotta win those together. We win together.”

The Lakers showed why they are one of the worst teams in the NBA when taking care of the basketball, turning it over 22 times. Reaves had eight turnovers. The Lakers are ranked 10th in the NBA in turnovers, averaging 16.6 per game.

“Got to figure the turnover thing out,” Redick said. “We’ll work with the guys to be better there.”

Warriors forward Georges Niang, left, and Lakers guard Collin Sexton go nose to nose as they exhange words on Friday.

Warriors forward Georges Niang and Lakers guard Collin Sexton exchange words during the first half of an NBA Cup game on Friday in San Francisco.

(Justine Willard / Associated Press)

After Jake LaRavia was called for an offensive foul with 21.8 seconds left in the third quarter, Doncic was hit with his first technical foul of the season.

But Doncic wasn’t the only Laker to lose his cool. The Lakers turned the ball over five times in the third quarter and wound up down 85-80 entering the fourth quarter.

With 8:02 left in the fourth and the Lakers down 95-80, Matisse Thybulle was hit with a technical foul and Curry made the ensuing free throw.

The Lakers actually went to sleep in the second quarter after building their 25-point lead and started to get cooked by the Warriors, who tied the score 53-53 at the half.

The Lakers were outscored 38-15 in the second quarter. Interesting enough, the Lakers outscored the Warriors 38-15 in the first quarter.

It was game on from there.

“The start of the second quarter, it was a bad way to start the quarter just in terms of the turnovers,” Redick said.

Six games into the season, the Lakers are still in search of who they are.

They won their first three games, but have now lost two of three.

They have nine new players and are still figuring things out.

“Yeah, look, we want to become a great team. You don’t become a great team in six games,” Redick said. “We want to become a great team after 82 games and have a chance to go compete for a championship in April and May and June. It’s a process to get there. We know we are going to be patient.

“There’s also, along with patience, doing what you’re supposed to do and I think as we play more games together, we do more walk-throughs together, we do more film together, we do more practices together, that we’ll all get better.”

Williams injury update

Ziaire Williams missed his second straight game because of left foot soreness. The starting forward has been one of the team’s better defenders.

“He still has some soreness,” Redick said. “He’s going to have to continue to monitor it. He was in shoot-around this morning. Again, just being really cautious with the amount of games we have throughout the season.”