So I’ve made this script and it’s not working please help me!!
here is the script
local gui = script.Parent
local MAINFRAME1 = gui.Parent
local MainFrame = MAINFRAME1.Parent
local Reset = gui.ResetBtn
local Replicated = game.ReplicatedStorage
local Value = game.Workspace.Value
local Chapter1 = game.Workspace:FindFirstChild(“Chapter1”)
local Chapter2 = game.Workspace:FindFirstChild(“Chapter2”)
local Chapter3 = game.Workspace:FindFirstChild(“Chapter3”)
local Chapter4 = game.Workspace:FindFirstChild(“Chapter4”)
local Chapter5 = game.Workspace:FindFirstChild(“Chapter5”)
Reset.MouseButton1Click:Connect(function()
if Chapter1.Parent == workspace then
game.Workspace.Chapter1.Parent = Replicated.Chapters
MAINFRAME1.Visible = false
MainFrame.PlayFrame.Visible = true
elseif Chapter2.Parent == workspace then
game.Workspace.Chapter1.Parent = Replicated.Chapters
MAINFRAME1.Visible = false
MainFrame.PlayFrame.Visible = true
elseif Chapter3.Parent == workspace then
game.Workspace.Chapter1.Parent = Replicated.Chapters
MAINFRAME1.Visible = false
MainFrame.PlayFrame.Visible = true
elseif Chapter4.Parent == workspace then
game.Workspace.Chapter1.Parent = Replicated.Chapters
MAINFRAME1.Visible = false
MainFrame.PlayFrame.Visible = true
elseif Chapter5.Parent == workspace then
game.Workspace.Chapter1.Parent = Replicated.Chapters
MAINFRAME1.Visible = false
MainFrame.PlayFrame.Visible = true
end
end)
here is the error
basically, the chapters aren’t in workspace they are in replicated storage