game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
--A few lines of code later (in a different script)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
for i, v in pairs(plr.PlayerGui:GetChildren()) do
if v:IsA('ScreenGui') then
v.Enabled = false
end
end
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
Then in a different script
Buttons.Exit.MouseButton1Click:Connect(function()
Holder:TweenPosition(UDim2.new(0.5,0,1.5,0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.4)
Tween:Cancel()
Camera.CameraType = Enum.CameraType.Custom
plr.Character.Humanoid.WalkSpeed = 16
wait(0.4)
script.Parent.Enabled = false
script.PromptObj.Value.Enabled = true
for i, v in pairs(plr.PlayerGui:GetChildren()) do
if v:IsA('ScreenGui') then
v.Enabled = v:GetAttribute('BaseUI')
end
end
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
script.Disabled = true
end)