Cant use get player state on event end play

Could you post the rest of the code as well? I need to access to the reference that’s return none, as well as the context.