LocalScript
script.Parent.MouseButton1Click:connect(function() local startergui = game:GetService("StarterGui") startergui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false) script.Parent.LocalScript2.Disabled = false script.Disabled = true end)
LocalScript2
script.Parent.MouseButton1Click:connect(function() local startergui = game:GetService("StarterGui") startergui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true) script.Parent.LocalScript.Disabled = false script.Disabled = true end)
How to make those 2 Chat disabler / enabler functions into one Script!?!
Use variables and if function
local on = false script.Parent.MouseButton1Click:connect(function() if on == true then --checks if on is set to true on = false --setting on to false local startergui = game:GetService("StarterGui") startergui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false) elseif on == false then --checks if on is set to false on = true --setting on to true local startergui = game:GetService("StarterGui") startergui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true) end end)