How would I unload chunks?

Hello!
I was making a chunk system and when I added the unloading system, it was not working correctly. My script didn’t get the chunks relative to the player, instead it got the chunks relative to 0, 0. I tried many different stuff, but none of them work? How would I do something like this?

Thanks,
Dragon