Cant use get player state on event end play

Sure, this is what I want to run when a player disconnects. It is not optimized and I am planning to redo it, but use of the player state will be required so this is still an issue. The only relevant screenshot is the first one and the last one I think, because that is where I get the player state.

133058-s4.png

The error occurs at the start when I try to get the player state, the error is as follows (From a packaged dedicated server when a player disconnects):

Edit: Grammar, typos.