Detroit Pistons forward Tobias Harris told dozens of student athletes Wednesday that his path from classrooms and basketball courts on Long Island to NBA stardom was carved by goal-setting, sheer will and persistence.

Harris, speaking to students at Hempstead’s Alverta B. Gray Schultz Middle School, stressed that they too can achieve great things if they set their minds to it and put in the effort.

“You have to have a plan to achieve, but you have to have a dream,” Harris said. “I never let anyone tell me . . . I couldn’t make it.”

His appearance was part of a tour he is making of schools on the Island. He has visited Westbury as well and plans to make stops in Uniondale and Wyandanch.

Harris, 23, who grew up on the Island and graduated from Half Hollow Hills West in Dix Hills in 2010, said he intends to continue addressing youth at basketball camps, clinics, mentoring and reading programs, particularly in disadvantaged communities where students can use the inspiration.

The 6-foot-9-inch forward drew from his experience as a varsity athlete. In his retelling, he was not always the best player on the court while growing up on Long Island. He played one season for the University of Tennessee before becoming the 19th pick in the NBA’s 2011 draft.

advertisement | advertise on newsday

Harris sought to offer a reality check and motivate the students as he described his climb — and emphasized how he still strives to excel.

He asked students what time they had gotten up to come to school, and noted that he had been up since 6 a.m. for a morning workout and that he planned to return to the gym later in the day.

“To play like a pro you have to work like a pro,” Harris said. “While you guys are waking up I’m already in the gym working on my jump.”

The 70-plus students in the room were taking it all in as the athlete stressed the importance of surrounding themselves with good friends and learning to give everyone their due respect.

They asked Harris about life and the game, and about playing with legendary stars such as LeBron James and Kobe Bryant.

At one point, Harris approached seventh-grader De’Andre Oates, 13, and gave him a $20 bill. Harris then asked Oates if he would trade that for whatever bill Harris had concealed in his pocket, which could be more or less. Oates traded, and got a $50 bill instead.

Sometimes “you have to take chances” and trust yourself, Harris said.

Oates, who plays basketball, said he was motivated by the talk.

“It will help me become a better person . . . like with my work ethic and my academics,” he said.

Jordan Satchell, 14, an eighth-grader, asked Harris for advice on whether a student should play the sport he likes or go for the one offering scholarships. He’s very good at lacrosse and has earned some scholarships, but enjoys playing basketball and football.

advertisement | advertise on newsday

Harris talked about the importance of having “a Plan B” outside sports and counseled the student not to turn away the opportunity to go to a good college.

In that way, Satchell said, Harris sounded a lot like his parents.

“I guess I’m going to pursue what my mom and dad want me to do, get into a good college, and hopefully things go from there,” Satchell said later.

Hank Williams, the school’s interim principal, used to coach Harris with an amateur team, and he jumped on the opportunity to showcase a success story for kids facing myriad challenges. Alverta B. Gray Schultz Middle is on the state’s list of struggling schools because of poor academic performance.

Williams said he hoped the talk would “give a seed of belief” to his students, so they know “that they can achieve what they want to achieve if they work hard to do it” — whether in the classroom or on the basketball court.