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

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
