Quick tip next time use ``` to make code sections to make your code easier to read
Well to start with your error suggests exactly what it says, in your server script the part where you have:
close:FireClient(main)
the first argument (your main variable) need to be something like
game.Players.Flaming_Lion75
not a string which you may have put
Second is that the OnClientEvent does not have a player argument as its first argument. It would just be:
close.OnClientEvent:Connect(function(main)
end)
And FINAL thing is that to set the players current GUI to non visible or visible you need to use playerGUI. For example:
-- Instead of using this:
game.StarterGui.CharacterSelectionGUI.Frame.Visible = false
-- Use this instead:
game.Players.LocalPlayer.PlayerGui.CharacterSelectionGUI.Frame.Visible = false
Some things cannot run in a localscript. But if your just trying to make something become visible and whatever your doing is compatible with localscripts then I agree you should simply just use one