function Receive(Q,z,...)local Y={...}if Q==User and z=="\112\108\097\121"then Connector:FireAllClients("\112\108\097\121",User,Y[1],Settings.SoundSource.Position,Settings.PianoSoundRange,Settings.PianoSounds,Y[2],Settings.IsCustom)HighlightPianoKey(Y[1]>61 and 61 or Y[1]<1 and 1 or Y[1],Y[3])elseif Q==User and z=="\097\098\111\114\116"then Deactivate()if SeatWeld then SeatWeld:remove()end end end function Activate(Q)Connector:FireClient(Q,"\097\099\116\105\118\097\116\101",Settings.CameraCFrame,Settings.PianoSounds,true)User=Q Startup()end function Deactivate()coroutine.resume(coroutine.create(Shutdown))wait()if User and User.Parent then Connector:FireClient(User,"\100\101\097\099\116\105\118\097\116\101")User.Character:SetPrimaryPartCFrame(Box.CFrame+Vector3.new(0,5,0))end User=nil end
----------------------------------
------------FUNCTIONS-------------
----------------------------------

function Receive(player, action, ...)
	local args = { ... }
	if player == User and action == "play" then
		Connector:FireAllClients(
			"play",
			User,
			args[1],
			Settings.SoundSource.Position,
			Settings.PianoSoundRange,
			Settings.PianoSounds,
			args[2],
			Settings.IsCustom
		)
		HighlightPianoKey((args[1] > 61 and 61) or (args[1] < 1 and 1) or args[1], args[3])
	elseif player == User and action == "abort" then
		Deactivate()
		if SeatWeld then
			SeatWeld:remove()
		end
	end
end

function Activate(player)
	Connector:FireClient(player, "activate", Settings.CameraCFrame, Settings.PianoSounds, true)
	User = player
	Startup()
end

function Deactivate()
	coroutine.resume(coroutine.create(Shutdown))
	wait()
	if User and User.Parent then
		Connector:FireClient(User, "deactivate")
		User.Character:SetPrimaryPartCFrame(Box.CFrame + Vector3.new(0, 5, 0))
	end
	User = nil
end
