"Attempt to index nil with PlayerGui"

Could you show us where you are closing/removing the Gui. After you’ve clicked exit or… something.

Is the closing of the gui from local script?

Pretty sure he is. Since there’s no mention of it in the script he provided, besides tweening it out.

Then that’s the problem though, it’s either he change local script into server script or he change server script into local script

Yeah, the whole script is a mess honestly. But if he doesn’t want to change it the best we can do is help fix it.

Why not use remote event, in this case since we just need it to be server script to do it