Can someone help shorten my code (1,760 lines)

Ok so my code is for a game called shape blitz which I’ll release soon. This game is set up in stages. Every stage will increase the difficulty as seen in my functions. The goal of the game is to tap on the squares and don’t touch the circles. This game is kind of like fruit ninja except you can’t let the squares fall either or you lose. This is the core code of the game and its placed under starterGUI. Can anyone help me shorten it without causing bugs?

local player = game.Players.LocalPlayer
local GAME = player.PlayerGui.Game
local lost = player.Lost
local fell = game.ReplicatedStorage.SquareFell
local wait1 = 1
local wait2 = 0.7
local wait3 = 0.6
local wait4 = 0.4
local wait5 = 0.2
local wait6 = 0.3
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(wait1)
	gg.Value = true
	if gg.Value == true then
		print("Spaqn")
		chooseShapestage1()
	elseif gg.Value == false then
		stage = 0
		return
	end
	wait(wait1)
	
	gg.Value = true
	if gg.Value == true then
		chooseShapestage1()
	elseif gg.Value == false then
		stage = 0
		return
	end
	wait(wait1)
	
	gg.Value = true
	if gg.Value == true then
		chooseShapestage1()
	elseif gg.Value == false then
		stage = 0
		return
	end
	wait(wait1)

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

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

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

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(wait2)
	if gg.Value == true then
		chooseShapestage2()
	elseif gg.Value == false then
		stage = 0
		STAGE.Value = "Easy"
		return
	end
	wait(wait2)
	if gg.Value == true then
		chooseShapestage2()
	elseif gg.Value == false then
		stage = 0
		STAGE.Value = "Easy"
		return
	end
	wait(wait2)
	if gg.Value == true then
		chooseShapestage2()
	elseif gg.Value == false then
		stage = 0
		STAGE.Value = "Easy"
		return
	end
	wait(wait2)
	if gg.Value == true then
		chooseShapestage2()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait2)
	if gg.Value == true then
		chooseShapestage2()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait2)
	if gg.Value == true then
		chooseShapestage2()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait2)
	if gg.Value == true then
		chooseShapestage2()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait2)
	if gg.Value == true then
		chooseShapestage2()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait2)
	if gg.Value == true then
		chooseShapestage2()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait2)
	if gg.Value == true then
		chooseShapestage2()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait2)
	if gg.Value == true then
		chooseShapestage2()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait2)
	if gg.Value == true then
		chooseShapestage2()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait2)
	if gg.Value == true then
		chooseShapestage2()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait2)
	wait2 = 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(wait3)
	if gg.Value == true then
		spawnTwoShapesstageThree()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait3)
	if gg.Value == true then
		chooseShapestage3()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait3)
	if gg.Value == true then
		spawnTwoShapesstageThree()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait3)
	if gg.Value == true then
		chooseShapestage3()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait3)
	if gg.Value == true then
		spawnTwoShapesstageThree()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait3)
	if gg.Value == true then
		chooseShapestage3()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait3)
	if gg.Value == true then
		chooseShapestage3()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait3)
	if gg.Value == true then
		chooseShapestage3()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait3)
	if gg.Value == true then
		spawnTwoShapesstageThree()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait3)
	if gg.Value == true then
		chooseShapestage3()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait3)
	if gg.Value == true then
		chooseShapestage3()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait3)
	if gg.Value == true then
		spawnTwoShapesstageThree()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait3)
	if gg.Value == true then
		chooseShapestage3()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait3)
	if gg.Value == true then
		spawnTwoShapesstageThree()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait3)
	if gg.Value == true then
		spawnTwoShapesstageThree()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait3)
	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(wait4)
		if gg.Value == true then
			spawnTwoShapesstageThree()
		elseif gg.Value == false then
			STAGE.Value = "Easy"
			stage = 0
			return
		end
		wait(wait4)
		if gg.Value == true then
			spawnTwoShapesstageThree()
		elseif gg.Value == false then
			STAGE.Value = "Easy"
			stage = 0
			return
		end
		wait(wait4)
		if gg.Value == true then
			chooseShapestage3()
		elseif gg.Value == false then
			STAGE.Value = "Easy"
			stage = 0
			return
		end
		wait(wait4)
		if gg.Value == true then
			chooseShapestage3()
		elseif gg.Value == false then
			STAGE.Value = "Easy"
			stage = 0
			return
		end
		wait(wait4)
		if gg.Value == true then
			spawnTwoShapesstageThree()
		elseif gg.Value == false then
			STAGE.Value = "Easy"
			stage = 0
			return
		end
		wait(wait4)
		if gg.Value == true then
			spawnTwoShapesstageThree()
		elseif gg.Value == false then
			STAGE.Value = "Easy"
			stage = 0
			return
		end
		wait(wait4)
		if gg.Value == true then
			spawnTwoShapesstageThree()
		elseif gg.Value == false then
			STAGE.Value = "Easy"
			stage = 0
			return
		end
		wait(wait4)
		if gg.Value == true then
			chooseShapestage3()
		elseif gg.Value == false then
			STAGE.Value = "Easy"
			stage = 0
			return
		end
		wait(wait4)
		if gg.Value == true then
			spawnTwoShapesstageThree()
		elseif gg.Value == false then
			STAGE.Value = "Easy"
			stage = 0
			return
		end
		wait(wait4)
		if gg.Value == true then
			spawnTwoShapesstageThree()
		elseif gg.Value == false then
			STAGE.Value = "Easy"
			stage = 0
			return
		end
		wait(wait4)
		if gg.Value == true then
			spawnTwoShapesstageThree()
		elseif gg.Value == false then
			STAGE.Value = "Easy"
			stage = 0
			return
		end
		wait(wait4)
		if gg.Value == true then
		spawnTwoShapesstageThree()
		elseif gg.Value == false then
			STAGE.Value = "Easy"
			stage = 0
			return
		end
		wait(wait4)
		if gg.Value == true then
			spawnTwoShapesstageThree()
		elseif gg.Value == false then
			STAGE.Value = "Easy"
			stage = 0
			return
		end
		wait(wait4)
		if gg.Value == true then
			chooseShapestage3()
		elseif gg.Value == false then
			STAGE.Value = "Easy"
			stage = 0
			return
		end
		wait(wait4)
		if gg.Value == true then
			chooseShapestage3()
		elseif gg.Value == false then
			STAGE.Value = "Easy"
			stage = 0
			return
		end
		wait(wait4)
		if gg.Value == true then
			spawnTwoShapesstageThree()
		elseif gg.Value == false then
			STAGE.Value = "Easy"
			stage = 0
			return
		end
	wait(wait4)
	if gg.Value == true then
		spawnTwoShapesstageThree()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait4)
	if gg.Value == true then
		chooseShapestage3()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait4)
	if gg.Value == true then
		chooseShapestage3()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait4)
	if gg.Value == true then
		spawnTwoShapesstageThree()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait4)
	if gg.Value == true then
		spawnTwoShapesstageThree()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait4)
	if gg.Value == true then
		chooseShapestage3()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait4)
	if gg.Value == true then
		chooseShapestage3()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait4)
	if gg.Value == true then
		spawnTwoShapesstageThree()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait4)
	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(wait5)
	if gg.Value == true then
		chooseShapestage5()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		spawnTwoShapesstageThree()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		spawnTwoShapesstageThree()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		spawnThreeShapesstageFive()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		spawnTwoShapesstageThree()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		chooseShapestage5()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		spawnTwoShapesstageThree()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		spawnTwoShapesstageThree()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		chooseShapestage5()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		spawnTwoShapesstageThree()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		spawnTwoShapesstageThree()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		chooseShapestage5()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		spawnTwoShapesstageThree()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		chooseShapestage5()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		spawnTwoShapesstageThree()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		spawnTwoShapesstageThree()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
	chooseShapestage5()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		spawnThreeShapesstageFive()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		spawnThreeShapesstageFive()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		spawnTwoShapesstageThree()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		chooseShapestage5()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		spawnThreeShapesstageFive()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		spawnThreeShapesstageFive()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		spawnTwoShapesstageThree()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		chooseShapestage5()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		spawnThreeShapesstageFive()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		spawnThreeShapesstageFive()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		spawnTwoShapesstageThree()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		chooseShapestage5()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		spawnThreeShapesstageFive()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		spawnThreeShapesstageFive()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	if gg.Value == true then
		spawnTwoShapesstageThree()
	elseif gg.Value == false then
		STAGE.Value = "Easy"
		stage = 0
		return
	end
	wait(wait5)
	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(wait6)
		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)
1 Like

I mean if it works it works, what can I say…

Mine can sometimes reach up to 2000 lines of codes but make sure it is compact, organized, so that you clearly know what part every each of your code segment does also you can use the Module Script to assist you in doing so, by reducing the amount of functions that sometime needs to be rewritten over and over again. But still, making too many functions in module script would… result in the same thing, just that it doesn’t look a whole messy in the Core Script

1 Like

Ok thanks for the feedback. There is a few things I’d like to add so I’ll make a new topic in just a second. Thank You!

Took a glimpse. I really do recommend you learn about for loops and indexing. Doing just this would probably cut the length of what I’m looking at by probably half, if not more.

There’s also just so many unnecessary things happening it almost looks like you’re making it longer on purpose. (Ex. SIX variables solely used for wait() as parameters)

3 Likes

This is also true, loops like for loops, others, etc. can sometimes assist with task that needs to be done over and over again

Oh yeah, I forgot to get rid of those. Don’t need them anymore! Thanks for pointing that out

A lot of this code can be replaced by loops, and with different functions, because you’re repeating yourself a whole lot in your code.

A lot of your code is also really unnecessary. Like this part:

local shapeType = math.random(1, 6)
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

The above can be replaced by:

createCirclestage3()

I mean technically not, But this doesn’t mean the OP did it the best way. There 2 different types of functions in that which are hard to see, but it would’ve actually been:

local shapeType = math.random(1, 6)
if shapeType == 1 then
   createCirclestage3()
else
   createSquarestage3()
end

@LycanrocG1234 I rewrote your script and was able to do in 200 lines of code which is like x9 less amount of code! Thats like really huge, your lucky if you can condense code to half the amount of lines (if it was effective), but I just used ~11.36% lines of code to achieve a similar result. (I didn’t really change it, just condensing and simplified. If I know what excatly the script did in greater detail like I wrote it, I could bring it down to like 170, but I’m lazy so yea.)

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 WaitTimesForStages = {1.5, 1.5, 1.2, 1.2, 1}
local ListOfPossiblePositions = {0.02, 0.241, 0.461, 0.67, 0.909}
local DifficultiesStrings = {"Easy", "Normal", "Medium", "Hard", "Chaos", "Infinite Chaos"}


local function CreateShape(IsASquare, TweenWaitTime)
	if IsASquare ~= false then 
		IsASquare = true
	end
	
	if not tonumber(TweenWaitTime) then 
		TweenWaitTime = 1.5
	end
	
	
	game.Workspace.SoundFX.SquareSpawn:Stop()
	if player.Lost.Value ~= true then
		local s = math.random(1,5)
		
		local Shape 
		
	 if IsASquare == true then
			Shape = GAME.Square:Clone()
		else
			Shape = GAME.Circle:Clone()
		end
		
		Shape.Position = GAME:FindFirstChild("t"..s).Position
		Shape.Visible = true
		Shape.Parent = GAME
		local tweeninfo = TweenInfo.new(TweenWaitTime,Enum.EasingStyle.Linear)
		local finalpos = UDim2.new(ListOfPossiblePositions[s], 0, 0.78, 0)
		
		local tween = game:GetService("TweenService"):Create(Shape, TweenInfo.new(TweenWaitTime), {Position = UDim2.new(Shape.Position.X.Scale, Shape.Position.X.Offset, Shape.Position.Y.Scale - 0.5, Shape.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(Shape, tweeninfo, {Position = finalpos})
		tween:Play()
		
		tween.Completed:Connect(function()
			
			tween2:Play()
			if IsASquare == true then
			tween2.Completed:Connect(function()
				if Shape.Parent == GAME and lost.Value ~= true then
					fell:FireServer()
					Shape: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)
	end
	
end


local function ChooseShape(StageNumber)
	local lost = player.Lost 
	if lost.Value ~= true then
		local shape = math.random(1,6)
		
		
		print(shape)
		if shape == 6 then 
			CreateShape(false, WaitTimesForStages[StageNumber])
		else
			CreateShape(true, WaitTimesForStages[StageNumber])
		end
	
	end
end

local function SpawnXAmountOfShapes(NumberOfShapes, StageNumber)
	repeat
		NumberOfShapes -= 1
		ChooseShape(StageNumber)
		task.wait(0.1)
	until NumberOfShapes == 0
end

local StageNumberList = {

	[1] = {
		["WhenToSpawn2"] = {},
		["WhenToSpawn3"] = {}, 
		["WhenToEnd"] = 12,
		["WaitTime"] = 1,
		["MusicInstance"] = game.Workspace.SoundFX.Uptown,
	},
	
	[2] = {
		["WhenToSpawn2"] = {},
		["WhenToSpawn3"] = {}, 
		["WhenToEnd"] = 14,
		["WaitTime"] = 0.7,
		["MusicInstance"] = game.Workspace.SoundFX.Normal,
	},
	
	[3] = {
		["WhenToSpawn2"] = {3, 5, 7, 11, 14, 16, 17},
		["WhenToSpawn3"] = {}, 
		["WhenToEnd"] = 17,
		["WaitTime"] = 0.6,
		["MusicInstance"] = game.Workspace.SoundFX.Medium,
	},
	
	[4] = {
		["WhenToSpawn2"] = {6, 7, 8, 10, 11, 12, 13, 14, 17, 18, 21, 22, 25},
		["WhenToSpawn3"] = {}, 
		["WhenToEnd"] = 25,
		["WaitTime"] = 0.4,
		["MusicInstance"] = game.Workspace.SoundFX.Hard,
	},
	
	[5] = {
		["WhenToSpawn2"] = {1, 3, 4, 6, 8, 9, 11, 12, 14, 16, 17, 21, 25, 29, 33},
		["WhenToSpawn3"] = {5, 19, 20, 23, 24, 27, 28, 31, 32}, 
		["WhenToEnd"] = 33,
		["WaitTime"] = 0.2,
		["MusicInstance"] = game.Workspace.SoundFX.Chaos,
	},
	
	[6] = {
		["WhenToSpawn2"] = {},
		["WhenToSpawn3"] = {}, 
		["WhenToEnd"] = math.huge,
		["WaitTime"] = 0.3,
		["MusicInstance"] = game.Workspace.SoundFX.Chaos,
	},
	
	

}


local function StartStages(StageNumber)
	local NumberWhereInList = 0
	STAGE.Value = DifficultiesStrings[StageNumber]
	stage = StageNumber
	StageNumberList[StageNumber]["MusicInstance"]:Play()
	task.wait(0.1)
	
	repeat
		NumberWhereInList += 1
		if gamestarted.Value == true then
			if table.find(StageNumberList[StageNumber]["WhenToSpawn3"], NumberWhereInList) or  StageNumberList[StageNumber]["WhenToEnd"] == math.huge then
				SpawnXAmountOfShapes(3, StageNumber)
			elseif table.find(StageNumberList[StageNumber]["WhenToSpawn2"], NumberWhereInList) then
				SpawnXAmountOfShapes(2, StageNumber)
			else
				ChooseShape(StageNumber)
			end
			
		elseif gamestarted.Value == false then
			stage = 0
			STAGE.Value = "Easy"
			NumberWhereInList = math.huge
			return 
		end
		
		task.wait(StageNumberList[StageNumber]["WaitTime"])
		gamestarted.Value = true
	until StageNumberList[StageNumber]["WhenToEnd"] <= NumberWhereInList
	
	StageNumberList[StageNumber]["MusicInstance"]:Stop()
	
end

local function GameStart()
	if gamestarted.Value == true then 
		StartStages(stage + 1)
	else 
		return
	end
end

game.ReplicatedStorage.G.OnClientEvent:Connect(function()
	if scriptcheck == false then
		task.wait(0.5)
		scriptcheck = true
		gamestarted.Value = true
		GameStart()
		task.wait(1)
		scriptcheck = false
	end
end)

Let me know if there are errors by replying


If you would like to get better at script, I would recommend a couple of things:

Learn functions more, specifically more about what you can pass through a function like variables. This allows you to use a similar function, and by using the function’s variables you can change small things and how its used!

Understand that you can write lines of code before if statements. This might seem obvious but you were writing most of your code inside of the if statments over and over again when it never changed. Like you cloned the same shape and parented it to the game ~6 times in 6 different if statements when you could have written it once outside the if statement.

Hope this helps and lmk if you have questions!

1 Like

Oh, I didn’t catch the difference lol, thanks for pointing that out.

Another thing I would suggest is to make your if statements more clear too. It’s way easier to read:

if value == false then

Instead of:

if value ~= true then

You also don’t need this return:

And you should be using workspace instead of game.Workspace.

1 Like

Hey thanks for looking over my scripts. A couple of things…

I was just using the old code and replacing the lines. If you don’t mind me asking why should I use one over the other. I personally like using game.workspace , myself. If it’s a deprecation issue or longer yield issue or has other value then just preference, if you can link to a reliable resource (dev forum post / from a roblox admin / roblox docs page) I would really appreciate it! (I couldn’t find anything about why I should use Workspace over game.workspace or game:GetService(“Workspace”) (ik that game:GetService() is the best choice, but idk about others))

Yea I just kept the code excatly the same, or as close as I could with condensing. Again…

I was debating on cutting them but I kept them just incase the developer was planning on adding something there or had a reason for it.

Now this is where some of it is mine and not. If your talking about lost.Value ~= true that was the creators choice and I didn’t change it. If your talking about one of mine like

(I flipped the functions trues and falses so that explanation is easier. It is not the same above in my long script)

local function CreateShape(IsASquare, TweenWaitTime)
	if IsASquare ~= true then 
		IsASquare = false
	end
end

This was actually done on purpose. Technically yours and my if statements are different Yours only includes the false value while mine considers false, nil and any other value, and converts it to false. This was because as I was writing it, before adding wait times variable, I just called making a shape with CreateShape() (Meaning that IsASquare was nil) While this may not be needed anymore I kept it just in case the creator wanted to make a shape, but passed invailed variables, that it wouldn’t throw an error and just make it a square instead…

Anyways thanks for reading it over and the feedback.

Some of the feedback was intended for OP, sorry if you misinterpreted that.

Just doing workspace is actually the best choice, it’s faster than both game.Workspace and game:GetService(“Workspace”) and also removes the possibility of erroring if the Workspace’s name is changed. It’s also better for readability.

This was more advice to OP, because a lot of time in his original script, he had unnecessary returns.

I was talking to the OP about how to write clearer code. Of course, if you want to consider nil too, then you can do what you were doing, but most of the time, it’s better for readability if you do what I said.

I would also add that you should be adding at least a few comments to help you improve code later on.

2 Likes

Could you, or someone else send the full shortened version of this code, I would like to see if I can shorten it even more.

This is my version here:

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 WaitTimesForStages = {1.5, 1.5, 1.2, 1.2, 1}
local ListOfPossiblePositions = {0.02, 0.241, 0.461, 0.67, 0.909}
local DifficultiesStrings = {"Easy", "Normal", "Medium", "Hard", "Chaos", "Infinite Chaos"}


local function CreateShape(IsASquare, TweenWaitTime)
	if IsASquare ~= false then 
		IsASquare = true
	end
	
	if not tonumber(TweenWaitTime) then 
		TweenWaitTime = 1.5
	end
	
	
	game.Workspace.SoundFX.SquareSpawn:Stop()
	if player.Lost.Value ~= true then
		local s = math.random(1,5)
		
		local Shape 
		
	 if IsASquare == true then
			Shape = GAME.Square:Clone()
		else
			Shape = GAME.Circle:Clone()
		end
		
		Shape.Position = GAME:FindFirstChild("t"..s).Position
		Shape.Visible = true
		Shape.Parent = GAME
		local tweeninfo = TweenInfo.new(TweenWaitTime,Enum.EasingStyle.Linear)
		local finalpos = UDim2.new(ListOfPossiblePositions[s], 0, 0.78, 0)
		
		local tween = game:GetService("TweenService"):Create(Shape, TweenInfo.new(TweenWaitTime), {Position = UDim2.new(Shape.Position.X.Scale, Shape.Position.X.Offset, Shape.Position.Y.Scale - 0.5, Shape.Position.Y.Offset)})
		local tween2 = game:GetService("TweenService"):Create(Shape, tweeninfo, {Position = finalpos})
		tween:Play()
		
		tween.Completed:Connect(function()
			
			tween2:Play()
			if IsASquare == true then
			tween2.Completed:Connect(function()
				if Shape.Parent == GAME and lost.Value ~= true then
					fell:FireServer()
					Shape: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)
	end
	
end


local function ChooseShape(StageNumber)
	local lost = player.Lost 
	if lost.Value ~= true then
		local shape = math.random(1,6)
		
		
		print(shape)
		if shape == 6 then 
			CreateShape(false, WaitTimesForStages[StageNumber])
		else
			CreateShape(true, WaitTimesForStages[StageNumber])
		end
	
	end
end

local function SpawnXAmountOfShapes(NumberOfShapes, StageNumber)
	repeat
		NumberOfShapes -= 1
		ChooseShape(StageNumber)
		task.wait(0.1)
	until NumberOfShapes == 0
end

local StageNumberList = {

	[1] = {
		["WhenToSpawn2"] = {},
		["WhenToSpawn3"] = {}, 
		["WhenToEnd"] = 12,
		["WaitTime"] = 1,
		["MusicInstance"] = game.Workspace.SoundFX.Uptown,
	},
	
	[2] = {
		["WhenToSpawn2"] = {},
		["WhenToSpawn3"] = {}, 
		["WhenToEnd"] = 14,
		["WaitTime"] = 0.7,
		["MusicInstance"] = game.Workspace.SoundFX.Normal,
	},
	
	[3] = {
		["WhenToSpawn2"] = {3, 5, 7, 11, 14, 16, 17},
		["WhenToSpawn3"] = {}, 
		["WhenToEnd"] = 17,
		["WaitTime"] = 0.6,
		["MusicInstance"] = game.Workspace.SoundFX.Medium,
	},
	
	[4] = {
		["WhenToSpawn2"] = {6, 7, 8, 10, 11, 12, 13, 14, 17, 18, 21, 22, 25},
		["WhenToSpawn3"] = {}, 
		["WhenToEnd"] = 25,
		["WaitTime"] = 0.4,
		["MusicInstance"] = game.Workspace.SoundFX.Hard,
	},
	
	[5] = {
		["WhenToSpawn2"] = {1, 3, 4, 6, 8, 9, 11, 12, 14, 16, 17, 21, 25, 29, 33},
		["WhenToSpawn3"] = {5, 19, 20, 23, 24, 27, 28, 31, 32}, 
		["WhenToEnd"] = 33,
		["WaitTime"] = 0.2,
		["MusicInstance"] = game.Workspace.SoundFX.Chaos,
	},
	
	[6] = {
		["WhenToSpawn2"] = {},
		["WhenToSpawn3"] = {}, 
		["WhenToEnd"] = math.huge,
		["WaitTime"] = 0.3,
		["MusicInstance"] = game.Workspace.SoundFX.Chaos,
	},
	
	

}


local function StartStages(StageNumber)
	local NumberWhereInList = 0
	STAGE.Value = DifficultiesStrings[StageNumber]
	stage = StageNumber
	StageNumberList[StageNumber]["MusicInstance"]:Play()
	task.wait(0.1)
	
	repeat
		NumberWhereInList += 1
		if gamestarted.Value == true then
			if table.find(StageNumberList[StageNumber]["WhenToSpawn3"], NumberWhereInList) or  StageNumberList[StageNumber]["WhenToEnd"] == math.huge then
				SpawnXAmountOfShapes(3, StageNumber)
			elseif table.find(StageNumberList[StageNumber]["WhenToSpawn2"], NumberWhereInList) then
				SpawnXAmountOfShapes(2, StageNumber)
			else
				ChooseShape(StageNumber)
			end
			
		elseif gamestarted.Value == false then
			stage = 0
			STAGE.Value = "Easy"
			NumberWhereInList = math.huge
			return 
		end
		
		task.wait(StageNumberList[StageNumber]["WaitTime"])
		gamestarted.Value = true
	until StageNumberList[StageNumber]["WhenToEnd"] <= NumberWhereInList
	
	StageNumberList[StageNumber]["MusicInstance"]:Stop()
	
end

local function GameStart()
	if gamestarted.Value == true then 
		StartStages(stage + 1)
	else 
		return
	end
end

game.ReplicatedStorage.G.OnClientEvent:Connect(function()
	if scriptcheck == false then
		task.wait(0.5)
		scriptcheck = true
		gamestarted.Value = true
		GameStart()
		task.wait(1)
		scriptcheck = false
	end
end)

Understand that I kept it as close to the Oringal code as possible (There are little differences in mine then the OG code, but they had to be made, but they do work very similarly. if your concerned about the differences, I can explain more, but the biggest thing I cut was a wait time difference. I can go into more detail, but it seemed to be a mistake then on purpose which is why I cut it out.) and I could simplify more, if I understood how this system was set up and what it does.

With that being said, if you want to remix it, enjoy. I know there are definitely some ways you can shorten this more, but I just wanted to make it readable from 1,760 to 200.

1 Like