--[[
	LOCATION GUIDE
	1 - HOME
	2 - DELETE
	3 - MUSIC ID
	4 - RADIO
	5 - GAME INFO
	6 - SETTINGS
	7 - POWER MODES
	8 - RIDEHEIGHT MODES
	9 - CAR INFO
	10 - AMBIENT SETTING
	
]]


local mod = "2018 Oaken Tehama TS Plus"

local specs = "2.0L twincharged, 7 seats"

local transm = "7-speed DCT"

local inf2 = "Enlighten V2.0"

local nms = require(script.M)["Names"]

function hov(x)
	if loca == 3 then
		if x == 1 then
			inf.Main.Info.L.Text = "Set/change ID"
		elseif x == 2 then
			inf.Main.Info.L.Text = "Play audio"
		elseif x == 3 then
			inf.Main.Info.L.Text = "Stop audio"
		else inf.Main.Info.L.Text = ""
		end
	elseif loca == 5 then
		if x == 1 then
			if workspace.FilteringEnabled == true then
				inf.Main.Info.L.Text = "FE Enabled"
			else
				inf.Main.Info.L.Text = "FE Disabled"
			end
		elseif x == 2 then
			if workspace:PGSIsEnabled() then
				inf.Main.Info.L.Text = "PGS Enabled"
			else
				inf.Main.Info.L.Text = "PGS Disabled"
			end
		elseif x == 3 then
			inf.Main.Info.L.Text = #(game.Players:GetChildren()).." Player(s)"
		else inf.Main.Info.L.Text = ""
		end
	elseif loca == 6 then
		if x == 1 then
			inf.Main.Info.L.Text = "Adjust power settings"
		elseif x == 2 then
			inf.Main.Info.L.Text = "Adjust ride settings"
		elseif x == 3 then
			inf.Main.Info.L.Text = "Adjust background ID"
		else inf.Main.Info.L.Text = ""
		end
	elseif loca == 7 then
		if x == 1 then
			inf.Main.Info.L.Text = "VALET - lowest power output"
		elseif x == 2 then
			inf.Main.Info.L.Text = "ECO - 60% power output"
		elseif x == 3 then
			inf.Main.Info.L.Text = "COMFORT - smoother, lower shifting points"
		elseif x == 4 then
			inf.Main.Info.L.Text = "SPORT - full power, full revs"
		else inf.Main.Info.L.Text = ""
		end
	elseif loca == 8 then
		if x == 1 then
			inf.Main.Info.L.Text = "ECO - higher ride, smoothest dynamics"
		elseif x == 2 then
			inf.Main.Info.L.Text = "COMFORT - smoother dynamics"
		elseif x == 3 then
			inf.Main.Info.L.Text = "SPORT - performance-based dynamics"
		else inf.Main.Info.L.Text = ""
		end
	elseif loca == 9 then
		if x == 1 then
			inf.Main.Info.L.Text = mod
		elseif x == 2 then
			inf.Main.Info.L.Text = specs
		elseif x == 3 then
			inf.Main.Info.L.Text = transm
		elseif x == 3 then
			inf.Main.Info.L.Text = inf2
		else inf.Main.Info.L.Text = ""
		end
	end
end

function names()
	local amt = #(nms[loca])
	sel = 1
	inf.Main.Select.Hover:TweenPosition(UDim2.new(0, 0, (sel/5)-.2, 0),"InOut","Quad",.5,true)
	inf.Main.Select.C1.Text = nms[loca][1]
	inf.Main.Select.C2.Text = nms[loca][2]
	if amt >= 3 then
		inf.Main.Select.C3.Text = nms[loca][3]
	else
		inf.Main.Select.C3.Text = ""
	end
	if amt >= 4 then
		inf.Main.Select.C4.Text = nms[loca][4]
	else
		inf.Main.Select.C4.Text = ""
	end
	if amt >= 5 then
		inf.Main.Select.C5.Text = nms[loca][5]
	else
		inf.Main.Select.C5.Text = ""
	end
end

function locate(sx,tx)
	inf.Main.Select:TweenSize(UDim2.new(-sx, 0, 0.8, 0),"InOut","Quad",1,true)
	inf.Main.Info:TweenSize(UDim2.new(1-sx, 0, 0.8, 0),"InOut","Quad",1,true)
	inf.Main.Info.L.Text = tx
end

locate(0.6,n)

inf.Back.MouseButton1Click:connect(function()
	home()
	names()
	input(false)
end)

function del()
	handler:FireServer('delete',game.Players.LocalPlayer.Name)
end
function home()
	loca = 1
	max = 5
	locate(0.6,n)
end
function delmenu()
	loca = 2
	max = 2
	locate(.3,"Are you sure?")
end

function idmenu()
	loca = 3
	locate(.4,"")
	max = 4
end

function preset(n)
	handler:FireServer('fm',n)
end

function radio(q,s)
	if q == "play" then
		handler:FireServer('updateSong',inf.Music.mg.Input.Text)
		input(false)
	elseif q == "stop" then
		handler:FireServer('pauseSong')
		input(false)
	elseif q == "set" then
		input(true)
	end
end

function light(c)
	handler:FireServer('ambient',c)
end

function input(open)
	if open == true then
		inf.Music.mg:TweenPosition(UDim2.new(0, 0, 1.1, 0),"InOut","Quad",.5,true)
	else
		inf.Music.mg:TweenPosition(UDim2.new(1, 0, 1.1, 0),"InOut","Quad",.5,true)
	end
end

inf.Enter.MouseButton1Click:connect(function()
	if loca == 1 then
		if sel == 1 then
			delmenu()
		elseif sel == 2 then
			loca = 3
			locate(.4,"Set ID")
			max = 4
		elseif sel == 3 then
			loca = 4
			locate(.6,"")
		elseif sel == 4 then
			loca = 5
		elseif sel == 5 then
			loca = 6
			locate(0.36,"")
		end
	elseif loca == 2 then
		if sel == 1 then
			del()
		elseif sel == 2 then
			home()
		end
	elseif loca == 3 then
		if sel == 1 then
			radio("set")
		elseif sel == 2 then
			radio("play")
		elseif sel == 3 then
			radio("stop")
		elseif sel == 4 then
			home()
		end
	elseif loca == 4 then
		if sel == 1 then
			preset(1)
		elseif sel == 2 then
			preset(2)
		elseif sel == 3 then
			preset(3)
		elseif sel == 4 then
			preset(4)
		elseif sel == 5 then
			home()
		end
	elseif loca == 5 then
		if sel == 4 then
			home()
		end
	elseif loca == 6 then
		if sel == 1 then
			loca = 7
		elseif sel == 2 then
			loca = 8
		elseif sel == 3 then