Yo Problem
Your main problem is that you're trying to use the StarterGui, when you need to use the Players PlayerGui. Also, you also need to make sure the PlayerGui is there before you do this.
Fix Dis Stauf
So let's try this script:
1 | while game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.PlayerList) = = true do |
2 | game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false ) |
3 | game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false ) |
4 | game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false ) |
(Tested and Works) - Put in a LocalScript
Anyways, if you have any further problems/questions, please leave a comment below and I'll see what I can do. Hope I helped :P
-Dyler3