function Receive(M,...)local b={...}if not ScriptReady then return end if M=="\097\099\116\105\118\097\116\101"then if not PlayingEnabled then Activate(b[1],b[2])end elseif M=="\100\101\097\099\116\105\118\097\116\101"then if PlayingEnabled then Deactivate()end elseif M=="\112\108\097\121"then if Player~=b[1]then PlayNoteServer(b[2],b[3],b[4],b[5])end end end function Activate(M,b)PlayingEnabled=true MakeHumanoidConnections()MakeKeyboardConnections()MakeGuiConnections()SetCamera(M)SetSounds(b)ShowPiano()end function Deactivate()PlayingEnabled=false BreakHumanoidConnections()BreakKeyboardConnections()BreakGuiConnections()HidePiano()HideSheets()ReturnCamera()Jump()end function PlayNoteClient(M)PlayNoteSound(M)HighlightPianoKey(M)Connector:FireServer("\112\108\097\121",M)end function PlayNoteServer(M,b,Q)PlayNoteSound(M,b,Q)end function Abort()Connector:FireServer("\097\098\111\114\116")end


function Receive(action, ...)
	local args = {...}
	if not ScriptReady then return end
	if action == "activate" then
		if not PlayingEnabled then
			Activate(args[1], args[2])
		end
	elseif action == "deactivate" then
		if PlayingEnabled then
			Deactivate()
		end
	elseif action == "play" then
		if Player ~= args[1] then
			PlayNoteServer(args[2], args[3], args[4], args[5])
		end
	end
end
function Activate(cameraCFrame, sounds)
	PlayingEnabled = true
	MakeHumanoidConnections()
	MakeKeyboardConnections()
	MakeGuiConnections()
	SetCamera(cameraCFrame)
	SetSounds(sounds)
	ShowPiano()
end
function Deactivate()
	PlayingEnabled = false
	BreakHumanoidConnections()
	BreakKeyboardConnections()
	BreakGuiConnections()
	HidePiano()
	HideSheets()
	ReturnCamera()	
	Jump()
end
function PlayNoteClient(note)
	PlayNoteSound(note)
	HighlightPianoKey(note)
	Connector:FireServer("play", note)
end
function PlayNoteServer(note, point, range)
	PlayNoteSound(note, point, range)
end
function Abort()
	Connector:FireServer("abort")
end
