Use of the N word in movies

Gi

So if a movie is set in any time period where slavery played a large role in Economy

Is it ok for a white actor to say the N word, if it’s in script and to be more historically accurate

Specifically if the movie is based around slavery, not just in the time period. As well as being Atleast 80% accurate to what history says