----------------------------------
------------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
