hum.Seated:connect(function(f,S)if f and S then local f=S.Parent.Parent local v=0 camparts={}for f,S in pairs(f.Keys:GetChildren())do if S and(S:IsA("\080\097\114\116")and string.match(S.Name,"\067\097\109\101\114\097"))then if string.match(S.Name,"\037\100")then if string.match(S.Name,"\050")then table.insert(camparts,2,S)elseif string.match(S.Name,"\051")then table.insert(camparts,3,S)elseif string.match(S.Name,"\052")then table.insert(camparts,4,S)elseif string.match(S.Name,"\053")then table.insert(camparts,5,S)end else table.insert(camparts,1,S)end v=v+1 end end if v>1 then cam.CameraType=Enum.CameraType.Scriptable for f=1,v,1 do gui.Frame["\067\097\109"..f].Visible=true end gui.Frame.Cam1.BackgroundColor3=selected end elseif not f then for f,S in pairs(gui.Frame:GetChildren())do S.Visible=false S.BackgroundColor3=idle cam.CameraType=Enum.CameraType.Custom end end wait(.1)end)plr.CharacterAdded:Connect(function(f)if f.Name==plr.Name then repeat hum=f:WaitForChild("\072\117\109\097\110\111\105\100")wait()until hum hum.Seated:connect(function(f,S)if f and S then local f=S.Parent.Parent local v=0 camparts={}for f,S in pairs(f.Keys:GetChildren())do if S and(S:IsA("\080\097\114\116")and string.match(S.Name,"\067\097\109\101\114\097"))then if string.match(S.Name,"\037\100")then if string.match(S.Name,"\050")then table.insert(camparts,2,S)elseif string.match(S.Name,"\051")then table.insert(camparts,3,S)elseif string.match(S.Name,"\052")then table.insert(camparts,4,S)elseif string.match(S.Name,"\053")then table.insert(camparts,5,S)end else table.insert(camparts,1,S)end v=v+1 end end if v>1 then cam.CameraType=Enum.CameraType.Scriptable for f=1,v,1 do gui.Frame["\067\097\109"..f].Visible=true end gui.Frame.Cam1.BackgroundColor3=selected end elseif not f then for f,S in pairs(gui.Frame:GetChildren())do S.Visible=false S.BackgroundColor3=idle cam.CameraType=Enum.CameraType.Custom end end wait(.1)end)wait()end end)for f,S in pairs(gui.Frame:GetChildren())do if S then S.MouseButton1Click:connect(function()if S.Visible then for f,S in pairs(gui.Frame:GetChildren())do S.BackgroundColor3=idle end local f for v,h in pairs(guicams)do if h==S then f=camparts[v]end end cam:Interpolate(f.CFrame*CFrame.new(0,0,1),f.CFrame,.5)S.BackgroundColor3=selected end end)end end


hum.Seated:connect(function(IsSeated,seat)
	if IsSeated and seat then
		local piano = seat.Parent.Parent
		local amt = 0
		camparts = {}
		for i,v in pairs(piano.Keys:GetChildren()) do
			if v and v:IsA("Part") and string.match(v.Name,"Camera") then
				if string.match(v.Name,"%d") then
					if string.match(v.Name,"2") then
						table.insert(camparts,2,v)
					elseif string.match(v.Name,"3") then
						table.insert(camparts,3,v)
					elseif string.match(v.Name,"4") then
						table.insert(camparts,4,v)
					elseif string.match(v.Name,"5") then
						table.insert(camparts,5,v)
					end
				else
					table.insert(camparts,1,v)
				end
				amt = amt + 1
			end
		end
		if amt > 1 then
			cam.CameraType = Enum.CameraType.Scriptable
			for i = 1,amt do
				gui.Frame["Cam"..i].Visible = true
			end
			gui.Frame.Cam1.BackgroundColor3 = selected
		end
	elseif not IsSeated then
		for i,v in pairs(gui.Frame:GetChildren()) do
			v.Visible = false
			v.BackgroundColor3 = idle
			cam.CameraType = Enum.CameraType.Custom
		end
	end
	wait(.1)
end)

plr.CharacterAdded:Connect(function(char)
	if char.Name == plr.Name then
		repeat hum = char:WaitForChild("Humanoid") wait() until hum
		hum.Seated:connect(function(IsSeated,seat)
			if IsSeated and seat then
				local piano = seat.Parent.Parent
				local amt = 0
				camparts = {}
				for i,v in pairs(piano.Keys:GetChildren()) do
					if v and v:IsA("Part") and string.match(v.Name,"Camera") then
						if string.match(v.Name,"%d") then
							if string.match(v.Name,"2") then
								table.insert(camparts,2,v)
							elseif string.match(v.Name,"3") then
								table.insert(camparts,3,v)
							elseif string.match(v.Name,"4") then
								table.insert(camparts,4,v)
							elseif string.match(v.Name,"5") then
								table.insert(camparts,5,v)
							end
						else
							table.insert(camparts,1,v)
						end
						amt = amt + 1
					end
				end
				if amt > 1 then
					cam.CameraType = Enum.CameraType.Scriptable
					for i = 1,amt do
						gui.Frame["Cam"..i].Visible = true
					end
					gui.Frame.Cam1.BackgroundColor3 = selected
				end
			elseif not IsSeated then
				for i,v in pairs(gui.Frame:GetChildren()) do
					v.Visible = false
					v.BackgroundColor3 = idle
					cam.CameraType = Enum.CameraType.Custom
				end
			end
			wait(.1)
		end)
		wait()
	end
end)

for i,v in pairs(gui.Frame:GetChildren()) do
	if v then
		v.MouseButton1Click:connect(function()
			if v.Visible then
				for a,b in pairs(gui.Frame:GetChildren()) do
					b.BackgroundColor3 = idle
				end
				local RealCam
				for a,b in pairs(guicams) do
					if b == v then
						RealCam = camparts[a]
					end
				end
				cam:Interpolate(RealCam.CFrame * CFrame.new(0, 0, 1),RealCam.CFrame,.5)
				v.BackgroundColor3 = selected
			end
		end)
	end
end
