Of course the script is bugged somehow if it is not working like it should.
JaTochNietDan just gave the solution for this problem.
It is NOT a bug. JaTochNietDan gave a solution to the problem, but It still doesn't make GetPlayerIp work under OnPlayerDisconnect, which you said was a bug.