Need Help Fixing BIG BUG!

My game is basically fruit ninja on Roblox. IN my game you have to click on the squares and not the circles. If you let a square fall you lose. My major bug is that the shapes don’t delete once I lose and once I lose enough times when I start the game nothing happens. I already tried using print statements to try and troubleshoot and see whats going wrong the the event fires once I click start but it doesn’t look like it starts the game! Most of my code is repetitive s taking a glance should give you an idea of my game.

local player = game.Players.LocalPlayer
local GAME = player.PlayerGui.Game
local lost = player.Lost
local fell = game.ReplicatedStorage.SquareFell
local stage = 0
local gamestarted = player:FindFirstChild(“GameGoing”)
local STAGE = player:FindFirstChild(“Stage”)
local scriptcheck = false
local function createSquare()
game.Workspace.SoundFX.SquareSpawn:Stop()
if player.Lost.Value ~= true then
local s = math.random(1,6)
if s == 1 then
local square = GAME.Square:Clone()
square.Position = GAME.t1.Position
square.Visible = true
square.Parent = GAME
local finalpos1 = UDim2.new(0.02, 0,0.78, 0)
local tweeninfo = TweenInfo.new(1.5,Enum.EasingStyle.Linear)
–make the square go up and down then self destruct
local tween = game:GetService(“TweenService”):Create(square, TweenInfo.new(1.5), {Position = UDim2.new(square.Position.X.Scale, square.Position.X.Offset, square.Position.Y.Scale - 0.5, square.Position.Y.Offset)})
local tween2 = game:GetService(“TweenService”):Create(square, tweeninfo, {Position = finalpos1})
tween:Play()
wait(1)
tween2:Play()
wait(1)
if square.Parent == GAME and lost.Value ~= true then
fell:FireServer()
square:Destroy()
player.Lost.Value = true
gamestarted.Value = false
game.Workspace.SoundFX.Lose:Play()
game.Workspace.SoundFX.Uptown:Stop()
game.Workspace.SoundFX.Normal:Stop()
game.Workspace.SoundFX.Medium:Stop()
game.Workspace.SoundFX.Hard:Stop()
game.Workspace.SoundFX.Chaos:Stop()
return
end

elseif s == 2 then 
			local square = GAME.Square:Clone()
		square.Position = GAME.t2.Position
		square.Visible = true
		square.Parent = GAME
		local finalpos1 = UDim2.new(0.241, 0,0.78, 0)
		local tweeninfo = TweenInfo.new(1.5,Enum.EasingStyle.Linear)
		--make the square go up and down then self destruct
		local tween = game:GetService("TweenService"):Create(square, TweenInfo.new(1.5), {Position = UDim2.new(square.Position.X.Scale, square.Position.X.Offset, square.Position.Y.Scale - 0.5, square.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(square, tweeninfo, {Position = finalpos1})
		tween:Play()
		wait(1)
		tween2:Play()
		wait(1)
		if square.Parent == GAME and lost.Value ~= true then
			fell:FireServer()
			square:Destroy()
			player.Lost.Value = true
			gamestarted.Value = false
			game.Workspace.SoundFX.Lose:Play()
			game.Workspace.SoundFX.Uptown:Stop()
			game.Workspace.SoundFX.Normal:Stop()
			game.Workspace.SoundFX.Medium:Stop()
			game.Workspace.SoundFX.Hard:Stop()
			game.Workspace.SoundFX.Chaos:Stop()
			return
	end
elseif s == 3 then 
		local square = GAME.Square:Clone()
		square.Position = GAME.t3.Position
		square.Visible = true
		square.Parent = GAME
		local finalpos1 = UDim2.new(0.461, 0,0.78, 0)
		local tweeninfo = TweenInfo.new(1.5,Enum.EasingStyle.Linear)
		--make the square go up and down then self destruct
		local tween = game:GetService("TweenService"):Create(square, TweenInfo.new(1.5), {Position = UDim2.new(square.Position.X.Scale, square.Position.X.Offset, square.Position.Y.Scale - 0.5, square.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(square, tweeninfo, {Position = finalpos1})
		tween:Play()
		wait(1)
		tween2:Play()
		wait(1)
		if square.Parent == GAME and lost.Value ~= true then
			fell:FireServer()
			square:Destroy()
			player.Lost.Value = true
			gamestarted.Value = false
			game.Workspace.SoundFX.Lose:Play()
			game.Workspace.SoundFX.Uptown:Stop()
			game.Workspace.SoundFX.Normal:Stop()
			game.Workspace.SoundFX.Medium:Stop()
			game.Workspace.SoundFX.Hard:Stop()
			game.Workspace.SoundFX.Chaos:Stop()
			return
	end
elseif s == 4 then 
		local square = GAME.Square:Clone()
		square.Position = GAME.t4.Position
		square.Visible = true
		square.Parent = GAME
			local finalpos1 = UDim2.new(0.67, 0,0.78, 0)
		local tweeninfo = TweenInfo.new(1.5,Enum.EasingStyle.Linear)
		--make the square go up and down then self destruct
		local tween = game:GetService("TweenService"):Create(square, TweenInfo.new(1.5), {Position = UDim2.new(square.Position.X.Scale, square.Position.X.Offset, square.Position.Y.Scale - 0.5, square.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(square, tweeninfo, {Position = finalpos1})
		tween:Play()
		wait(1)
		tween2:Play()
		wait(1)
		if square.Parent == GAME and lost.Value ~= true then
			fell:FireServer()
			square:Destroy()
			player.Lost.Value = true
			gamestarted.Value = false
			game.Workspace.SoundFX.Lose:Play()
			game.Workspace.SoundFX.Uptown:Stop()
			game.Workspace.SoundFX.Normal:Stop()
			game.Workspace.SoundFX.Medium:Stop()
			game.Workspace.SoundFX.Hard:Stop()
			game.Workspace.SoundFX.Chaos:Stop()
			return
	end
elseif s == 5 then 
		local square = GAME.Square:Clone()
		square.Position = GAME.t5.Position
		square.Visible = true
		square.Parent = GAME
			local finalpos1 = UDim2.new(0.909, 0,0.78, 0)
		local tweeninfo = TweenInfo.new(1.5,Enum.EasingStyle.Linear)
		--make the square go up and down then self destruct
		local tween = game:GetService("TweenService"):Create(square, TweenInfo.new(1.5), {Position = UDim2.new(square.Position.X.Scale, square.Position.X.Offset, square.Position.Y.Scale - 0.5, square.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(square, tweeninfo, {Position = finalpos1})
		tween:Play()
		wait(1)
		tween2:Play()
		wait(1)
		if square.Parent == GAME and lost.Value ~= true then
			fell:FireServer()
			square:Destroy()
			player.Lost.Value = true
			gamestarted.Value = false
			game.Workspace.SoundFX.Lose:Play()
			game.Workspace.SoundFX.Uptown:Stop()
			game.Workspace.SoundFX.Normal:Stop()
			game.Workspace.SoundFX.Medium:Stop()
			game.Workspace.SoundFX.Hard:Stop()
			game.Workspace.SoundFX.Chaos:Stop()
			return
			end
	end
end

end

local function createSquarestage3()
game.Workspace.SoundFX.SquareSpawn:Stop()
if player.Lost.Value ~= true then
local s = math.random(1,6)
if s == 1 then
local square = GAME.Square:Clone()
square.Position = GAME.t1.Position
square.Visible = true
square.Parent = GAME
local finalpos1 = UDim2.new(0.02, 0,0.78, 0)
local tweeninfo = TweenInfo.new(1.2,Enum.EasingStyle.Linear)
–make the square go up and down then self destruct
local tween = game:GetService(“TweenService”):Create(square, TweenInfo.new(1.2), {Position = UDim2.new(square.Position.X.Scale, square.Position.X.Offset, square.Position.Y.Scale - 0.5, square.Position.Y.Offset)})
local tween2 = game:GetService(“TweenService”):Create(square, tweeninfo, {Position = finalpos1})
tween:Play()
wait(1)
tween2:Play()
wait(1)
if square.Parent == GAME and lost.Value ~= true then
fell:FireServer()
square:Destroy()
player.Lost.Value = true
gamestarted.Value = false
game.Workspace.SoundFX.Lose:Play()
game.Workspace.SoundFX.Uptown:Stop()
game.Workspace.SoundFX.Medium:Stop()
game.Workspace.SoundFX.Normal:Stop()
game.Workspace.SoundFX.Hard:Stop()
game.Workspace.SoundFX.Chaos:Stop()
return
end

	elseif s == 2 then 
		local square = GAME.Square:Clone()
		square.Position = GAME.t2.Position
		square.Visible = true
		square.Parent = GAME
		local finalpos1 = UDim2.new(0.241, 0,0.78, 0)
		local tweeninfo = TweenInfo.new(1.2,Enum.EasingStyle.Linear)
		--make the square go up and down then self destruct
		local tween = game:GetService("TweenService"):Create(square, TweenInfo.new(1.2), {Position = UDim2.new(square.Position.X.Scale, square.Position.X.Offset, square.Position.Y.Scale - 0.5, square.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(square, tweeninfo, {Position = finalpos1})
		tween:Play()
		wait(1)
		tween2:Play()
		wait(1)
		if square.Parent == GAME and lost.Value ~= true then
			fell:FireServer()
			square:Destroy()
			player.Lost.Value = true
			gamestarted.Value = false
			game.Workspace.SoundFX.Lose:Play()
			game.Workspace.SoundFX.Uptown:Stop()
			game.Workspace.SoundFX.Medium:Stop()
			game.Workspace.SoundFX.Normal:Stop()
			game.Workspace.SoundFX.Hard:Stop()
			game.Workspace.SoundFX.Chaos:Stop()
			return
		end
	elseif s == 3 then 
		local square = GAME.Square:Clone()
		square.Position = GAME.t3.Position
		square.Visible = true
		square.Parent = GAME
		local finalpos1 = UDim2.new(0.461, 0,0.78, 0)
		local tweeninfo = TweenInfo.new(1.2,Enum.EasingStyle.Linear)
		--make the square go up and down then self destruct
		local tween = game:GetService("TweenService"):Create(square, TweenInfo.new(1.2), {Position = UDim2.new(square.Position.X.Scale, square.Position.X.Offset, square.Position.Y.Scale - 0.5, square.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(square, tweeninfo, {Position = finalpos1})
		tween:Play()
		wait(1)
		tween2:Play()
		wait(1)
		if square.Parent == GAME and lost.Value ~= true then
			fell:FireServer()
			square:Destroy()
			player.Lost.Value = true
			gamestarted.Value = false
			game.Workspace.SoundFX.Lose:Play()
			game.Workspace.SoundFX.Uptown:Stop()
			game.Workspace.SoundFX.Medium:Stop()
			game.Workspace.SoundFX.Normal:Stop()
			game.Workspace.SoundFX.Hard:Stop()
			game.Workspace.SoundFX.Chaos:Stop()
			return
		end
	elseif s == 4 then 
		local square = GAME.Square:Clone()
		square.Position = GAME.t4.Position
		square.Visible = true
		square.Parent = GAME
		local finalpos1 = UDim2.new(0.67, 0,0.78, 0)
		local tweeninfo = TweenInfo.new(1.2,Enum.EasingStyle.Linear)
		--make the square go up and down then self destruct
		local tween = game:GetService("TweenService"):Create(square, TweenInfo.new(1.2), {Position = UDim2.new(square.Position.X.Scale, square.Position.X.Offset, square.Position.Y.Scale - 0.5, square.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(square, tweeninfo, {Position = finalpos1})
		tween:Play()
		wait(1)
		tween2:Play()
		wait(1)
		if square.Parent == GAME and lost.Value ~= true then
			fell:FireServer()
			square:Destroy()
			player.Lost.Value = true
			gamestarted.Value = false
			game.Workspace.SoundFX.Lose:Play()
			game.Workspace.SoundFX.Uptown:Stop()
			game.Workspace.SoundFX.Medium:Stop()
			game.Workspace.SoundFX.Normal:Stop()
			game.Workspace.SoundFX.Hard:Stop()
			game.Workspace.SoundFX.Chaos:Stop()
			return
		end
	elseif s == 5 then 
		local square = GAME.Square:Clone()
		square.Position = GAME.t5.Position
		square.Visible = true
		square.Parent = GAME
		local finalpos1 = UDim2.new(0.909, 0,0.78, 0)
		local tweeninfo = TweenInfo.new(1.5,Enum.EasingStyle.Linear)
		--make the square go up and down then self destruct
		local tween = game:GetService("TweenService"):Create(square, TweenInfo.new(1), {Position = UDim2.new(square.Position.X.Scale, square.Position.X.Offset, square.Position.Y.Scale - 0.5, square.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(square, tweeninfo, {Position = finalpos1})
		tween:Play()
		wait(1)
		tween2:Play()
		wait(1)
		if square.Parent == GAME and lost.Value ~= true then
			fell:FireServer()
			square:Destroy()
			player.Lost.Value = true
			gamestarted.Value = false
			game.Workspace.SoundFX.Lose:Play()
			game.Workspace.SoundFX.Uptown:Stop()
			game.Workspace.SoundFX.Medium:Stop()
			game.Workspace.SoundFX.Normal:Stop()
			game.Workspace.SoundFX.Hard:Stop()
			game.Workspace.SoundFX.Chaos:Stop()
			return
		end
	end
end

end

local function createSquarestage5()
game.Workspace.SoundFX.SquareSpawn:Stop()
if player.Lost.Value ~= true then
local s = math.random(1,6)
if s == 1 then
local square = GAME.Square:Clone()
square.Position = GAME.t1.Position
square.Visible = true
square.Parent = GAME
local finalpos1 = UDim2.new(0.02, 0,0.78, 0)
local tweeninfo = TweenInfo.new(1,Enum.EasingStyle.Linear)
–make the square go up and down then self destruct
local tween = game:GetService(“TweenService”):Create(square, TweenInfo.new(1), {Position = UDim2.new(square.Position.X.Scale, square.Position.X.Offset, square.Position.Y.Scale - 0.5, square.Position.Y.Offset)})
local tween2 = game:GetService(“TweenService”):Create(square, tweeninfo, {Position = finalpos1})
tween:Play()
wait(1)
tween2:Play()
wait(1)
if square.Parent == GAME and lost.Value ~= true then
fell:FireServer()
square:Destroy()
player.Lost.Value = true
gamestarted.Value = false
game.Workspace.SoundFX.Lose:Play()
game.Workspace.SoundFX.Uptown:Stop()
game.Workspace.SoundFX.Medium:Stop()
game.Workspace.SoundFX.Normal:Stop()
game.Workspace.SoundFX.Hard:Stop()
game.Workspace.SoundFX.Chaos:Stop()
return
end

	elseif s == 2 then 
		local square = GAME.Square:Clone()
		square.Position = GAME.t2.Position
		square.Visible = true
		square.Parent = GAME
		local finalpos1 = UDim2.new(0.241, 0,0.78, 0)
		local tweeninfo = TweenInfo.new(1,Enum.EasingStyle.Linear)
		--make the square go up and down then self destruct
		local tween = game:GetService("TweenService"):Create(square, TweenInfo.new(1), {Position = UDim2.new(square.Position.X.Scale, square.Position.X.Offset, square.Position.Y.Scale - 0.5, square.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(square, tweeninfo, {Position = finalpos1})
		tween:Play()
		wait(1)
		tween2:Play()
		wait(1)
		if square.Parent == GAME and lost.Value ~= true then
			fell:FireServer()
			square:Destroy()
			player.Lost.Value = true
			gamestarted.Value = false
			game.Workspace.SoundFX.Lose:Play()
			game.Workspace.SoundFX.Uptown:Stop()
			game.Workspace.SoundFX.Medium:Stop()
			game.Workspace.SoundFX.Normal:Stop()
			game.Workspace.SoundFX.Hard:Stop()
			game.Workspace.SoundFX.Chaos:Stop()
			return
		end
	elseif s == 3 then 
		local square = GAME.Square:Clone()
		square.Position = GAME.t3.Position
		square.Visible = true
		square.Parent = GAME
		local finalpos1 = UDim2.new(0.461, 0,0.78, 0)
		local tweeninfo = TweenInfo.new(1,Enum.EasingStyle.Linear)
		--make the square go up and down then self destruct
		local tween = game:GetService("TweenService"):Create(square, TweenInfo.new(1), {Position = UDim2.new(square.Position.X.Scale, square.Position.X.Offset, square.Position.Y.Scale - 0.5, square.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(square, tweeninfo, {Position = finalpos1})
		tween:Play()
		wait(1)
		tween2:Play()
		wait(1)
		if square.Parent == GAME and lost.Value ~= true then
			fell:FireServer()
			square:Destroy()
			player.Lost.Value = true
			gamestarted.Value = false
			game.Workspace.SoundFX.Lose:Play()
			game.Workspace.SoundFX.Uptown:Stop()
			game.Workspace.SoundFX.Medium:Stop()
			game.Workspace.SoundFX.Normal:Stop()
			game.Workspace.SoundFX.Hard:Stop()
			game.Workspace.SoundFX.Chaos:Stop()
			return
		end
	elseif s == 4 then 
		local square = GAME.Square:Clone()
		square.Position = GAME.t4.Position
		square.Visible = true
		square.Parent = GAME
		local finalpos1 = UDim2.new(0.67, 0,0.78, 0)
		local tweeninfo = TweenInfo.new(1,Enum.EasingStyle.Linear)
		--make the square go up and down then self destruct
		local tween = game:GetService("TweenService"):Create(square, TweenInfo.new(1), {Position = UDim2.new(square.Position.X.Scale, square.Position.X.Offset, square.Position.Y.Scale - 0.5, square.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(square, tweeninfo, {Position = finalpos1})
		tween:Play()
		wait(1)
		tween2:Play()
		wait(1)
		if square.Parent == GAME and lost.Value ~= true then
			fell:FireServer()
			square:Destroy()
			player.Lost.Value = true
			gamestarted.Value = false
			game.Workspace.SoundFX.Lose:Play()
			game.Workspace.SoundFX.Uptown:Stop()
			game.Workspace.SoundFX.Medium:Stop()
			game.Workspace.SoundFX.Normal:Stop()
			game.Workspace.SoundFX.Hard:Stop()
			game.Workspace.SoundFX.Chaos:Stop()
			return
		end
	elseif s == 5 then 
		local square = GAME.Square:Clone()
		square.Position = GAME.t5.Position
		square.Visible = true
		square.Parent = GAME
		local finalpos1 = UDim2.new(0.909, 0,0.78, 0)
		local tweeninfo = TweenInfo.new(1,Enum.EasingStyle.Linear)
		--make the square go up and down then self destruct
		local tween = game:GetService("TweenService"):Create(square, TweenInfo.new(1), {Position = UDim2.new(square.Position.X.Scale, square.Position.X.Offset, square.Position.Y.Scale - 0.5, square.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(square, tweeninfo, {Position = finalpos1})
		tween:Play()
		wait(1)
		tween2:Play()
		wait(1)
		if square.Parent == GAME and lost.Value ~= true then
			fell:FireServer()
			square:Destroy()
			player.Lost.Value = true
			gamestarted.Value = false
			game.Workspace.SoundFX.Lose:Play()
			game.Workspace.SoundFX.Uptown:Stop()
			game.Workspace.SoundFX.Medium:Stop()
			game.Workspace.SoundFX.Normal:Stop()
			game.Workspace.SoundFX.Hard:Stop()
			game.Workspace.SoundFX.Chaos:Stop()
			return
		end
	end
end

end

local function createCircle()
if player.Lost.Value ~= true then
local s = math.random(1,6)
if s == 1 then
local circle = GAME.Circle:Clone()
circle.Position = GAME.t1.Position
circle.Visible = true
circle.Parent = GAME
local finalpos1 = UDim2.new(0.02, 0,0.78, 0)
–make the square go up and down then self destruct
local tween = game:GetService(“TweenService”):Create(circle, TweenInfo.new(1.5), {Position = UDim2.new(circle.Position.X.Scale, circle.Position.X.Offset, circle.Position.Y.Scale - 0.5, circle.Position.Y.Offset)})
local tween2 = game:GetService(“TweenService”):Create(circle, TweenInfo.new(1.5), {Position = finalpos1})
tween:Play()
wait(1)
tween2:Play()
wait(1)
circle:Destroy()

elseif s == 2 then 
	local circle = GAME.Circle:Clone()
	circle.Visible = true
	circle.Parent = GAME
		circle.Position = GAME.t2.Position
		local finalpos1 = UDim2.new(0.241, 0,0.78, 0)
	--make the square go up and down then self destruct
		local tween = game:GetService("TweenService"):Create(circle, TweenInfo.new(1.5), {Position = UDim2.new(circle.Position.X.Scale, circle.Position.X.Offset, circle.Position.Y.Scale - 0.5, circle.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(circle, TweenInfo.new(1.5), {Position = finalpos1})
		tween:Play()
		wait(1)
		tween2:Play()
		wait(1)
	circle:Destroy()

elseif s == 3 then 
	local circle = GAME.Circle:Clone()
	circle.Visible = true
	circle.Parent = GAME
		circle.Position = GAME.t3.Position
		local finalpos1 = UDim2.new(0.461, 0,0.78, 0)
	--make the square go up and down then self destruct
		local tween = game:GetService("TweenService"):Create(circle, TweenInfo.new(1.5), {Position = UDim2.new(circle.Position.X.Scale, circle.Position.X.Offset, circle.Position.Y.Scale - 0.5, circle.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(circle, TweenInfo.new(1.5), {Position = finalpos1})
		tween:Play()
		wait(1)
		tween2:Play()
		wait(1)
	circle:Destroy()
	
elseif s == 4 then 
	local circle = GAME.Circle:Clone()
	circle.Visible = true
	circle.Parent = GAME
		circle.Position = GAME.t4.Position
		local finalpos1 = UDim2.new(0.67, 0,0.78, 0)
	--make the square go up and down then self destruct
		local tween = game:GetService("TweenService"):Create(circle, TweenInfo.new(1.5), {Position = UDim2.new(circle.Position.X.Scale, circle.Position.X.Offset, circle.Position.Y.Scale - 0.5, circle.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(circle, TweenInfo.new(1.5), {Position = finalpos1})
		tween:Play()
		wait(1)
		tween2:Play()
		wait(1)
	circle:Destroy()
	
elseif s == 5 then 
	local circle = GAME.Circle:Clone()
	circle.Visible = true
	circle.Parent = GAME
		circle.Position = GAME.t5.Position
		local finalpos1 = UDim2.new(0.909, 0,0.78, 0)
	--make the square go up and down then self destruct
		local tween = game:GetService("TweenService"):Create(circle, TweenInfo.new(1.5), {Position = UDim2.new(circle.Position.X.Scale, circle.Position.X.Offset, circle.Position.Y.Scale - 0.5, circle.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(circle, TweenInfo.new(1.5), {Position = finalpos1})
		tween:Play()
		wait(1)
		tween2:Play()
		wait(1)
	circle:Destroy()

end
end
end

local function createCirclestage3()
if player.Lost.Value ~= true then
local s = math.random(1,6)
if s == 1 then
local circle = GAME.Circle:Clone()
circle.Position = GAME.t1.Position
circle.Visible = true
circle.Parent = GAME
local finalpos1 = UDim2.new(0.02, 0,0.78, 0)
–make the square go up and down then self destruct
local tween = game:GetService(“TweenService”):Create(circle, TweenInfo.new(1.2), {Position = UDim2.new(circle.Position.X.Scale, circle.Position.X.Offset, circle.Position.Y.Scale - 0.5, circle.Position.Y.Offset)})
local tween2 = game:GetService(“TweenService”):Create(circle, TweenInfo.new(1.2), {Position = finalpos1})
tween:Play()
wait(1)
tween2:Play()
wait(1)
circle:Destroy()

	elseif s == 2 then 
		local circle = GAME.Circle:Clone()
		circle.Visible = true
		circle.Parent = GAME
		circle.Position = GAME.t2.Position
		local finalpos1 = UDim2.new(0.241, 0,0.78, 0)
		--make the square go up and down then self destruct
		local tween = game:GetService("TweenService"):Create(circle, TweenInfo.new(1.2), {Position = UDim2.new(circle.Position.X.Scale, circle.Position.X.Offset, circle.Position.Y.Scale - 0.5, circle.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(circle, TweenInfo.new(1.2), {Position = finalpos1})
		tween:Play()
		wait(1)
		tween2:Play()
		wait(1)
		circle:Destroy()

	elseif s == 3 then 
		local circle = GAME.Circle:Clone()
		circle.Visible = true
		circle.Parent = GAME
		circle.Position = GAME.t3.Position
		local finalpos1 = UDim2.new(0.461, 0,0.78, 0)
		--make the square go up and down then self destruct
		local tween = game:GetService("TweenService"):Create(circle, TweenInfo.new(1.2), {Position = UDim2.new(circle.Position.X.Scale, circle.Position.X.Offset, circle.Position.Y.Scale - 0.5, circle.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(circle, TweenInfo.new(1.2), {Position = finalpos1})
		tween:Play()
		wait(1)
		tween2:Play()
		wait(1)
		circle:Destroy()

	elseif s == 4 then 
		local circle = GAME.Circle:Clone()
		circle.Visible = true
		circle.Parent = GAME
		circle.Position = GAME.t4.Position
		local finalpos1 = UDim2.new(0.67, 0,0.78, 0)
		--make the square go up and down then self destruct
		local tween = game:GetService("TweenService"):Create(circle, TweenInfo.new(1.2), {Position = UDim2.new(circle.Position.X.Scale, circle.Position.X.Offset, circle.Position.Y.Scale - 0.5, circle.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(circle, TweenInfo.new(1.2), {Position = finalpos1})
		tween:Play()
		wait(1)
		tween2:Play()
		wait(1)
		circle:Destroy()

	elseif s == 5 then 
		local circle = GAME.Circle:Clone()
		circle.Visible = true
		circle.Parent = GAME
		circle.Position = GAME.t5.Position
		local finalpos1 = UDim2.new(0.909, 0,0.78, 0)
		--make the square go up and down then self destruct
		local tween = game:GetService("TweenService"):Create(circle, TweenInfo.new(1.2), {Position = UDim2.new(circle.Position.X.Scale, circle.Position.X.Offset, circle.Position.Y.Scale - 0.5, circle.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(circle, TweenInfo.new(1.2), {Position = finalpos1})
		tween:Play()
		wait(1)
		tween2:Play()
		wait(1)
		circle:Destroy()
	end
end

end

local function createCirclestage5()
if player.Lost.Value ~= true then
local s = math.random(1,6)
if s == 1 then
local circle = GAME.Circle:Clone()
circle.Position = GAME.t1.Position
circle.Visible = true
circle.Parent = GAME
local finalpos1 = UDim2.new(0.02, 0,0.78, 0)
–make the square go up and down then self destruct
local tween = game:GetService(“TweenService”):Create(circle, TweenInfo.new(1), {Position = UDim2.new(circle.Position.X.Scale, circle.Position.X.Offset, circle.Position.Y.Scale - 0.5, circle.Position.Y.Offset)})
local tween2 = game:GetService(“TweenService”):Create(circle, TweenInfo.new(1), {Position = finalpos1})
tween:Play()
wait(1)
tween2:Play()
wait(1)
circle:Destroy()

	elseif s == 2 then 
		local circle = GAME.Circle:Clone()
		circle.Visible = true
		circle.Parent = GAME
		circle.Position = GAME.t2.Position
		local finalpos1 = UDim2.new(0.241, 0,0.78, 0)
		--make the square go up and down then self destruct
		local tween = game:GetService("TweenService"):Create(circle, TweenInfo.new(1), {Position = UDim2.new(circle.Position.X.Scale, circle.Position.X.Offset, circle.Position.Y.Scale - 0.5, circle.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(circle, TweenInfo.new(1), {Position = finalpos1})
		tween:Play()
		wait(1)
		tween2:Play()
		wait(1)
		circle:Destroy()

	elseif s == 3 then 
		local circle = GAME.Circle:Clone()
		circle.Visible = true
		circle.Parent = GAME
		circle.Position = GAME.t3.Position
		local finalpos1 = UDim2.new(0.461, 0,0.78, 0)
		--make the square go up and down then self destruct
		local tween = game:GetService("TweenService"):Create(circle, TweenInfo.new(1), {Position = UDim2.new(circle.Position.X.Scale, circle.Position.X.Offset, circle.Position.Y.Scale - 0.5, circle.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(circle, TweenInfo.new(1), {Position = finalpos1})
		tween:Play()
		wait(1)
		tween2:Play()
		wait(1)
		circle:Destroy()

	elseif s == 4 then 
		local circle = GAME.Circle:Clone()
		circle.Visible = true
		circle.Parent = GAME
		circle.Position = GAME.t4.Position
		local finalpos1 = UDim2.new(0.67, 0,0.78, 0)
		--make the square go up and down then self destruct
		local tween = game:GetService("TweenService"):Create(circle, TweenInfo.new(1), {Position = UDim2.new(circle.Position.X.Scale, circle.Position.X.Offset, circle.Position.Y.Scale - 0.5, circle.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(circle, TweenInfo.new(1), {Position = finalpos1})
		tween:Play()
		wait(1)
		tween2:Play()
		wait(1)
		circle:Destroy()

	elseif s == 5 then 
		local circle = GAME.Circle:Clone()
		circle.Visible = true
		circle.Parent = GAME
		circle.Position = GAME.t5.Position
		local finalpos1 = UDim2.new(0.909, 0,0.78, 0)
		--make the square go up and down then self destruct
		local tween = game:GetService("TweenService"):Create(circle, TweenInfo.new(1), {Position = UDim2.new(circle.Position.X.Scale, circle.Position.X.Offset, circle.Position.Y.Scale - 0.5, circle.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(circle, TweenInfo.new(1), {Position = finalpos1})
		tween:Play()
		wait(1)
		tween2:Play()
		wait(1)
		circle:Destroy()
	end
end

end

local function chooseShapestage1()
local lost = player.Lost
if lost.Value ~= true then
local shape = math.random(1,6)
print(shape)
if shape == 1 then
createSquare()
elseif shape == 2 then
createSquare()
elseif shape == 3 then
createSquare()
elseif shape == 4 then
createSquare()
elseif shape == 5 then
createSquare()
elseif shape == 6 then
createCircle()
end
end
end

local function chooseShapestage2()
local lost = player.Lost
if lost.Value ~= true then
local shape = math.random(1,6)
print(shape)
if shape == 3 then
createSquare()
elseif shape == 4 then
createSquare()
elseif shape == 5 then
createSquare()
elseif shape == 6 then
createSquare()
elseif shape == 1 then
createSquare()
elseif shape == 2 then
createCircle()
end
end
end

local function chooseShapestage3()
local lost = player.Lost
if lost.Value ~= true then
local shape = math.random(1,6)
print(shape)
if shape == 3 then
createSquarestage3()
elseif shape == 4 then
createSquarestage3()
elseif shape == 5 then
createSquarestage3()
elseif shape == 6 then
createSquarestage3()
elseif shape == 1 then
createSquarestage3()
elseif shape == 2 then
createCirclestage3()
end
end
end

local function chooseShapestage5()
local lost = player.Lost
if lost.Value ~= true then
local shape = math.random(1,6)
print(shape)
if shape == 3 then
createSquarestage5()
elseif shape == 4 then
createSquarestage5()
elseif shape == 5 then
createSquarestage5()
elseif shape == 6 then
createSquarestage5()
elseif shape == 1 then
createCirclestage5()
elseif shape == 2 then
createCirclestage5()
end
end
end

local function spawnTwoShapesstageThree()
local lost = player.Lost
if lost.Value ~= true then
local shape1 = math.random(1, 6)
local shape2 = math.random(1, 6)
print(“Spawning Shapes in Stage Three”)

	local function spawnShape(shapeType)
		if shapeType == 3 then
			createSquarestage3()
		elseif shapeType == 4 then
			createSquarestage3()
		elseif shapeType == 5 then
			createSquarestage3()
		elseif shapeType == 6 then
			createSquarestage3()
		elseif shapeType == 1 then
			createSquarestage3()
		elseif shapeType == 2 then
			createCirclestage3()
		end
	end

	-- Use a coroutine to spawn two shapes simultaneously
	local function spawnTwoShapes()
		spawnShape(shape1)
		wait(0.1)  -- Adjust the delay as needed to control the timing
		spawnShape(shape2)
	end

	coroutine.wrap(spawnTwoShapes)()
end

end

local function spawnThreeShapesstageFive()
local lost = player.Lost
if lost.Value ~= true then
local shape1 = math.random(1, 6)
local shape2 = math.random(1, 6)
local shape3 = math.random(1,6)
print(“Spawning Shapes in Stage Three”)

	local function spawnShape(shapeType)
		if shapeType == 3 then
			createSquarestage3()
		elseif shapeType == 4 then
			createSquarestage3()
		elseif shapeType == 5 then
			createSquarestage3()
		elseif shapeType == 6 then
			createSquarestage3()
		elseif shapeType == 1 then
			createSquarestage3()
		elseif shapeType == 2 then
			createCirclestage3()
		end
	end

	-- Use a coroutine to spawn two shapes simultaneously
	local function spawnTwoShapesstage5()
		spawnShape(shape1)
		wait(0.1)  -- Adjust the delay as needed to control the timing
		spawnShape(shape2)
		wait(0.1)
		spawnShape(shape3)
	end

	coroutine.wrap(spawnTwoShapesstage5)()
end

end

local gg = player.GameGoing
local function stageOne()
STAGE.Value = “Easy”
stage = 1
wait(0.1)
if gg.Value == true then
chooseShapestage1()
elseif gg.Value == false then
return
end
wait(1)
gg.Value = true
if gg.Value == true then
print(“Spaqn”)
chooseShapestage1()
elseif gg.Value == false then
stage = 0
return
end
wait(1)

gg.Value = true
if gg.Value == true then
	chooseShapestage1()
elseif gg.Value == false then
	stage = 0
	return
end
wait(1)

gg.Value = true
if gg.Value == true then
	chooseShapestage1()
elseif gg.Value == false then
	stage = 0
	return
end
wait(1)

gg.Value = true
if gg.Value == true then
	chooseShapestage1()
elseif gg.Value == false then
	stage = 0
	return
end
wait(1)

gg.Value = true
if gg.Value == true then
	chooseShapestage1()
elseif gg.Value == false then
	stage = 0
	return
end
wait(1)

gg.Value = true
if gg.Value == true then
	chooseShapestage1()
elseif gg.Value == false then
	stage = 0
	return
end
wait(1)

gg.Value = true
if gg.Value == true then
	chooseShapestage1()
elseif gg.Value == false then
	stage = 0
	return
end
wait(1)

gg.Value = true
if gg.Value == true then
	chooseShapestage1()
elseif gg.Value == false then
	stage = 0
return
end
wait(1)

gg.Value = true
if gg.Value == true then
	chooseShapestage1()
elseif gg.Value == false then
	stage = 0
	return
end
wait(1)
gg.Value = true
if gg.Value == true then
	chooseShapestage1()
elseif gg.Value == false then
	stage = 0
	return
end
wait(1)
gg.Value = true
if gg.Value == true then
	chooseShapestage1()
elseif gg.Value == false then
	stage = 0
	return
end
wait(1)
game.Workspace.SoundFX.Uptown:Stop()

end

local function stageTwo()
STAGE.Value = “Normal”
stage = 2
game.Workspace.SoundFX.Normal:Play()
if gg.Value == true then
chooseShapestage2()
elseif gg.Value == false then
stage = 0
STAGE.Value = “Easy”
return
end
wait(0.7)
if gg.Value == true then
chooseShapestage2()
elseif gg.Value == false then
stage = 0
STAGE.Value = “Easy”
return
end
wait(0.7)
if gg.Value == true then
chooseShapestage2()
elseif gg.Value == false then
stage = 0
STAGE.Value = “Easy”
return
end
wait(0.7)
if gg.Value == true then
chooseShapestage2()
elseif gg.Value == false then
stage = 0
STAGE.Value = “Easy”
return
end
wait(0.7)
if gg.Value == true then
chooseShapestage2()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.7)
if gg.Value == true then
chooseShapestage2()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.7)
if gg.Value == true then
chooseShapestage2()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.7)
if gg.Value == true then
chooseShapestage2()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.7)
if gg.Value == true then
chooseShapestage2()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.7)
if gg.Value == true then
chooseShapestage2()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.7)
if gg.Value == true then
chooseShapestage2()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.7)
if gg.Value == true then
chooseShapestage2()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.7)
if gg.Value == true then
chooseShapestage2()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.7)
if gg.Value == true then
chooseShapestage2()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.7)
game.Workspace.SoundFX.Normal:Stop()
end

local function stageThree()
STAGE.Value = “Medium”
game.Workspace.SoundFX.Medium:Play()
if gg.Value == true then
chooseShapestage3()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
if gg.Value == true then
chooseShapestage3()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.6)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.6)
if gg.Value == true then
chooseShapestage3()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.6)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.6)
if gg.Value == true then
chooseShapestage3()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.6)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.6)
if gg.Value == true then
chooseShapestage3()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.6)
if gg.Value == true then
chooseShapestage3()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.6)
if gg.Value == true then
chooseShapestage3()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.6)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.6)
if gg.Value == true then
chooseShapestage3()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.6)
if gg.Value == true then
chooseShapestage3()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.6)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.6)
if gg.Value == true then
chooseShapestage3()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.6)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.6)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.6)
stage = 3
game.Workspace.SoundFX.Medium:Stop()
end

local function stageFour()
STAGE.Value = “Hard”
game.Workspace.SoundFX.Hard:Play()
if gg.Value == true then
chooseShapestage3()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.4)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.4)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.4)
if gg.Value == true then
chooseShapestage3()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.4)
if gg.Value == true then
chooseShapestage3()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.4)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.4)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.4)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.4)
if gg.Value == true then
chooseShapestage3()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.4)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.4)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.4)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.4)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.4)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.4)
if gg.Value == true then
chooseShapestage3()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.4)
if gg.Value == true then
chooseShapestage3()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.4)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.4)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.4)
if gg.Value == true then
chooseShapestage3()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.4)
if gg.Value == true then
chooseShapestage3()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.4)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.4)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.4)
if gg.Value == true then
chooseShapestage3()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.4)
if gg.Value == true then
chooseShapestage3()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.4)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.4)
stage = 4
game.Workspace.SoundFX.Hard:Stop()

end

local function stageFive()
STAGE.Value = “Chaos”
game.Workspace.SoundFX.Chaos:Play()
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
chooseShapestage5()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
spawnThreeShapesstageFive()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
chooseShapestage5()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
chooseShapestage5()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
chooseShapestage5()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
chooseShapestage5()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
chooseShapestage5()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
spawnThreeShapesstageFive()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
spawnThreeShapesstageFive()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
chooseShapestage5()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
spawnThreeShapesstageFive()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
spawnThreeShapesstageFive()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
chooseShapestage5()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
spawnThreeShapesstageFive()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
spawnThreeShapesstageFive()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
chooseShapestage5()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
spawnThreeShapesstageFive()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
spawnThreeShapesstageFive()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
if gg.Value == true then
spawnTwoShapesstageThree()
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
return
end
wait(0.3)
stage = 5
end

local function infiniteChaos()
STAGE.Value = “Infinite Chaos”
game.Workspace.SoundFX.Chaos:Stop()
game.Workspace.SoundFX.Chaos:Play()
game.Workspace.SoundFX.Chaos.PlaybackSpeed = 2
while true do
if gg.Value == true then
spawnThreeShapesstageFive()
wait(0.3)
elseif gg.Value == false then
STAGE.Value = “Easy”
stage = 0
break
end
end
end

local function GameStart()
if gg.Value == true and stage == 0 then
stageOne()
else
return
end
if gg.Value == true and stage == 1 then
stageTwo()
else
return
end
if gg.Value == true and stage == 2 then
stageThree()
else
return
end
if gg.Value == true and stage == 3 then
stageFour()
else
return
end
if gg.Value == true and stage == 4 then
stageFive()
else
return
end
if gg.Value == true and stage == 5 then
infiniteChaos()
else
return
end
end

game.ReplicatedStorage.G.OnClientEvent:Connect(function()
if scriptcheck == false then
wait(0.5)
scriptcheck = true
print(“ClientFired”)
gamestarted.Value = true
print(“GameStarted”)
GameStart()
wait(1)
scriptcheck = false
end
end)

dude, send the code that you suspect it to be the line causing the issue, developers doesn’t have 25 hours a day :skull:

if you can’t break apart the code to find which line is causing the problem then sadly i can’t really do much of a help

2 Likes

I’m sorry for putting so much. Like I said most of the code is repetitive and for a specific line I don’t have one. But what I can say is that the event fires and this script starts but it just doesn’t start round one it’ll play the music but it won’t spawn shapes. That’s all I l know.

can you format your script properly? its a headache to read that

How do I do that? Sorry about my code… :sweat_smile:

I see that most of your code is using functions(), without these lines your code could be shorten temporary. Can you tell me what specifically happened? Like from the beginning to the end, is the fruit or shape whatever you call it doesn’t spawn?

I suspect that the beginning of the code local functions() most likely to be the issue, the rest i think it’s just calling these functions

unfortunately though, i won’t able to reply any longer after this message because i got to go soon.

2 Likes

you need to divide scripts by using ``` before and after each script.
for example;

this is code
this is code number 2

and this is not code at all.
i can see you did that for some of the scripts though, but you need to do that for all. also, whats the specific error you’re getting? and at which scripts?

but, yeah. this post is just long and confusing without the specific dividers

Again I’m sorry for the confusing code. Theres no specific error message I’m getting. The code just stops working after I lose a few times.

2 Likes

Broo this is way too much and it isn’t formatted like others have suggested :sob:

This is like reading an cluttered dictionary.

Try:

‘``
Code
‘’`

I’m sorry once again I’ll do better next time I post code. I will try to simplify it soon. (Sorry)

1 Like

Is there a specific part where it’s stopping? Not literally, like if it stops working during the fruit falling (then you’d show the correlating code).

Yes it stops right after the event fires. The game doesn’t start the “easy” stage it just stays on the same screen

1 Like

Could you reply with the code correlating with what you just mentioned?

game.ReplicatedStorage.G.OnClientEvent:Connect(function()
	if scriptcheck == false then
		wait(0.5)
		scriptcheck = true
	print("ClientFired")
	gamestarted.Value = true
	print("GameStarted")
		GameStart()
		wait(1)
		scriptcheck = false
		end
end)
1 Like

Both statements print but the game doesn’t start

1 Like

There’s a GameStart() function. Could you provide that code?

local function GameStart()
	if gg.Value == true and stage == 0 then 
		stageOne()
	else
		return
	end
	if gg.Value == true  and stage == 1 then 
	stageTwo()
	else
		return
	end
	if gg.Value == true and stage == 2 then 
		stageThree()
	else
		return
	end
	if gg.Value == true and stage == 3 then 
		stageFour()
	else
		return
	end
	if gg.Value == true and stage == 4 then 
		stageFive()
	else
		return
	end
	if gg.Value == true and stage == 5 then 
		infiniteChaos()
	else
		return
	end
end
1 Like

The stage is automatically set to 0 once the player losses

1 Like

What is the gg value…? Yeah that’s kinda stumping me.

Oh srry for not defining it. Its stands for game started. It a bool value that turns true once I click the play button it helps make sure the game stops running if the game isn’t playing