I am working on an Options Gui, and I have just ran into this error while trying to script a mute chat script.
Everything Here is in a Local Script
Here is what is necessary for you to know:
local options = script.Parent.Options
local muteChatVar = script.Parent.Options.MuteChatSwitch
local chatSwitch = options.MuteChatFlip.Switch
local playerGui = player:WaitForChild("PlayerGui")
local playerStats = playerGui:WaitForChild("PlayerStats")
local chatFrame = playerStats:WaitForChild("Chat")
local chats = chatFrame:GetChildren()
chatSwitch.MouseEnter:connect(function(onEnter)
wait(0.03)
enterS:Play()
end)
chatSwitch.MouseButton1Click:connect(function(onClicked)
wait(0.03)
clickS:Play()
if muteChatVar.Value == "Off" then
chatSwitch:TweenPosition(UDim2.new(0, 0, 0, 0), "In", "Quint", 0.5)
muteChatVar.Value = "On"
chats:Clone()
chats:Clone().Parent = replicatedStorage.Chats
chats:Remove()
elseif muteChatVar.Value == "On" then
chatSwitch:TweenPosition(UDim2.new(0.5, 0, 0, 0), "Out", "Quint", 0.5)
muteChatVar.Value = "Off"
local newchats = replicatedStorage.Chats:GetChildren()
newchats:Clone()
newchats:Clone().Parent = chatFrame
end
end)
All help is appreciated! Comment below if you need any more information about it!

1 comment
The error is for line 20,21 and 27,28